diff --git a/run/nobody/deluge.sh b/run/nobody/deluge.sh index 2fe2734..0bb652d 100644 --- a/run/nobody/deluge.sh +++ b/run/nobody/deluge.sh @@ -1,5 +1,8 @@ #!/usr/bin/dumb-init /bin/bash +# source in script to wait for child processes to exit +source /usr/local/bin/waitproc.sh + if [[ "${deluge_running}" == "false" ]]; then echo "[info] Attempting to start Deluge..." @@ -43,8 +46,8 @@ if [[ "${deluge_running}" == "false" ]]; then fi - # run deluge daemon (daemonized, non-blocking) - /usr/bin/deluged -c /config -L "${DELUGE_DAEMON_LOG_LEVEL}" -l /config/deluged.log + # run process non daemonised but backgrounded so we can control sigterm + nohup /usr/bin/deluged -d -c /config -L "${DELUGE_DAEMON_LOG_LEVEL}" -l /config/deluged.log & # make sure process deluged DOES exist retry_count=12 @@ -117,7 +120,7 @@ if [[ "${deluge_web_running}" == "false" ]]; then echo "[info] Starting Deluge Web UI..." - # run deluge-web + # run process non daemonised but backgrounded so we can control sigterm nohup /usr/bin/deluge-web -c /config -L "${DELUGE_WEB_LOG_LEVEL}" -l /config/deluge-web.log & echo "[info] Deluge Web UI started" diff --git a/run/nobody/torrentcheck.sh b/run/nobody/torrentcheck.sh index 3b78d30..b940365 100644 --- a/run/nobody/torrentcheck.sh +++ b/run/nobody/torrentcheck.sh @@ -6,7 +6,7 @@ # identify any torrents with state error and save these torrent id's as an array torrent_id_error_array=( $(deluge-console -c /config "info -v" | grep -B 1 'State: Error' | xargs | grep -P -o -m 1 '(?<=ID:\s)[^\s]+' | xargs) ) -if [[ -n ${torrent_id_error_array[@]} ]]; then +if [[ -n ${torrent_id_error_array[*]} ]]; then echo "[warn] Torrents with state 'Error' found"