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
|
anywait "$job_pid"; job_exit=127
|
||||||
else
|
else
|
||||||
printf '%s' "$job_pid" > "$service_pidfile"
|
printf '%s' "$job_pid" > "$service_pidfile"
|
||||||
|
|
||||||
wait "$job_pid"; job_exit=$?
|
wait "$job_pid"; job_exit=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Record the job exit code
|
||||||
|
printf '%d' "$job_exit" > "$service_exit_file"
|
||||||
|
|
||||||
# One service failure, two service failures...
|
# One service failure, two service failures...
|
||||||
if service_success_exit u "$job_exit"; then
|
if service_success_exit u "$job_exit"; then
|
||||||
job_success = 1
|
job_success = 1
|
||||||
@@ -300,8 +302,6 @@ svc() {
|
|||||||
# Sleep a bit between restarts
|
# Sleep a bit between restarts
|
||||||
sleep "$service_respawn_delay"
|
sleep "$service_respawn_delay"
|
||||||
done
|
done
|
||||||
|
|
||||||
#svc::cleanup
|
|
||||||
}; readonly -f svc
|
}; readonly -f svc
|
||||||
|
|
||||||
## Run a command with its output discarded
|
## Run a command with its output discarded
|
||||||
|
|||||||
Reference in New Issue
Block a user