move the recording of the exit outside of the cleanup, it does not actually run between respawns lmao
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
@@ -265,10 +265,12 @@ svc() {
|
||||
anywait "$job_pid"; job_exit=127
|
||||
else
|
||||
printf '%s' "$job_pid" > "$service_pidfile"
|
||||
|
||||
wait "$job_pid"; job_exit=$?
|
||||
fi
|
||||
|
||||
# Record the job exit code
|
||||
printf '%d' "$job_exit" > "$service_exit_file"
|
||||
|
||||
# One service failure, two service failures...
|
||||
if service_success_exit u "$job_exit"; then
|
||||
job_success = 1
|
||||
@@ -300,8 +302,6 @@ svc() {
|
||||
# Sleep a bit between restarts
|
||||
sleep "$service_respawn_delay"
|
||||
done
|
||||
|
||||
#svc::cleanup
|
||||
}; readonly -f svc
|
||||
|
||||
## Run a command with its output discarded
|
||||
|
||||
Reference in New Issue
Block a user