diff --git a/src/deployer.sh b/src/deployer.sh index 70a8106..dd1a2ff 100755 --- a/src/deployer.sh +++ b/src/deployer.sh @@ -233,25 +233,15 @@ process_loop() ( log_info "Process new request '${request}'." process_request & done < <(ncat --listen --keep-open --unixsock "${deployer_sock}") + log_critical "Unexpected end of listening at '${deployer_sock}'." else log_info "Start listening unixsock without keep-open at '${deployer_sock}'." while read -r request; do log_info "Process new request '${request}'." process_request done < <(ncat --listen --unixsock "${deployer_sock}") + log_info "End of listening at '${deployer_sock}'." 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() ( @@ -433,7 +423,6 @@ main() ( log_info "Run process loop in foreground." echo "$$" >"${deployer_pid}" process_loop - jobs -p | xargs kill 2>/dev/null || true fi ;; stop) diff --git a/src/runner.sh b/src/runner.sh index aaa3081..d78451e 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -293,25 +293,15 @@ process_loop() ( log_info "Process new request '${request}'." process_request & done < <(ncat --listen --keep-open --unixsock "${runner_sock}") + log_critical "Unexpected end of listening at '${deployer_sock}'." else log_info "Start listening unixsock without keep-open at '${runner_sock}'." while read -r request; do log_info "Process new request '${request}'." process_request done < <(ncat --listen --unixsock "${runner_sock}") + log_info "End of listening at '${deployer_sock}'." 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() ( @@ -534,7 +524,6 @@ main() ( log_info "Run process loop in foreground." echo "$$" >"${runner_pid}" process_loop - jobs -p | xargs kill 2>/dev/null || true fi ;; stop)