Skip to content

Commit

Permalink
Merge pull request #385 from binhex/wait-proc
Browse files Browse the repository at this point in the history
stab at fixing wait for child proc
  • Loading branch information
binhex authored Nov 13, 2023
2 parents e92881e + 9fbe9f8 commit b193bb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions run/nobody/deluge.sh
Original file line number Diff line number Diff line change
@@ -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..."
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion run/nobody/torrentcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit b193bb8

Please sign in to comment.