[Dev] Do not kill child jobs when stopping runner and deployer
This commit is contained in:
parent
8df10d8ad4
commit
711ad6dc9e
|
@ -233,25 +233,15 @@ process_loop() (
|
||||||
log_info "Process new request '${request}'."
|
log_info "Process new request '${request}'."
|
||||||
process_request &
|
process_request &
|
||||||
done < <(ncat --listen --keep-open --unixsock "${deployer_sock}")
|
done < <(ncat --listen --keep-open --unixsock "${deployer_sock}")
|
||||||
|
log_critical "Unexpected end of listening at '${deployer_sock}'."
|
||||||
else
|
else
|
||||||
log_info "Start listening unixsock without keep-open at '${deployer_sock}'."
|
log_info "Start listening unixsock without keep-open at '${deployer_sock}'."
|
||||||
while read -r request; do
|
while read -r request; do
|
||||||
log_info "Process new request '${request}'."
|
log_info "Process new request '${request}'."
|
||||||
process_request
|
process_request
|
||||||
done < <(ncat --listen --unixsock "${deployer_sock}")
|
done < <(ncat --listen --unixsock "${deployer_sock}")
|
||||||
|
log_info "End of listening at '${deployer_sock}'."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kill all remaining subprocesses only if daemon.
|
|
||||||
log_info "End of loop."
|
|
||||||
if "${daemon}"; then
|
|
||||||
log_debug "Kill child jobs."
|
|
||||||
jobs -p | xargs kill 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove sock file
|
|
||||||
log_debug "Remove deployer unixsock file."
|
|
||||||
rm --force "${deployer_sock}"
|
|
||||||
log_info "End of process."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
main() (
|
main() (
|
||||||
|
@ -433,7 +423,6 @@ main() (
|
||||||
log_info "Run process loop in foreground."
|
log_info "Run process loop in foreground."
|
||||||
echo "$$" >"${deployer_pid}"
|
echo "$$" >"${deployer_pid}"
|
||||||
process_loop
|
process_loop
|
||||||
jobs -p | xargs kill 2>/dev/null || true
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|
|
@ -293,25 +293,15 @@ process_loop() (
|
||||||
log_info "Process new request '${request}'."
|
log_info "Process new request '${request}'."
|
||||||
process_request &
|
process_request &
|
||||||
done < <(ncat --listen --keep-open --unixsock "${runner_sock}")
|
done < <(ncat --listen --keep-open --unixsock "${runner_sock}")
|
||||||
|
log_critical "Unexpected end of listening at '${deployer_sock}'."
|
||||||
else
|
else
|
||||||
log_info "Start listening unixsock without keep-open at '${runner_sock}'."
|
log_info "Start listening unixsock without keep-open at '${runner_sock}'."
|
||||||
while read -r request; do
|
while read -r request; do
|
||||||
log_info "Process new request '${request}'."
|
log_info "Process new request '${request}'."
|
||||||
process_request
|
process_request
|
||||||
done < <(ncat --listen --unixsock "${runner_sock}")
|
done < <(ncat --listen --unixsock "${runner_sock}")
|
||||||
|
log_info "End of listening at '${deployer_sock}'."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kill all remaining subprocesses only if daemon.
|
|
||||||
log_info "End of loop."
|
|
||||||
if "${daemonize}"; then
|
|
||||||
log_debug "Kill child jobs."
|
|
||||||
jobs -p | xargs kill 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove sock file.
|
|
||||||
log_debug "Remove deployer unixsock file."
|
|
||||||
rm --force "${runner_sock}"
|
|
||||||
log_info "End of process."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
main() (
|
main() (
|
||||||
|
@ -534,7 +524,6 @@ main() (
|
||||||
log_info "Run process loop in foreground."
|
log_info "Run process loop in foreground."
|
||||||
echo "$$" >"${runner_pid}"
|
echo "$$" >"${runner_pid}"
|
||||||
process_loop
|
process_loop
|
||||||
jobs -p | xargs kill 2>/dev/null || true
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|
Loading…
Reference in New Issue