service: give stop and reload scripts their own timeout

Both were bounded by killdelay, the delay between the stop signal and
SIGKILL, because service_run_script() had nothing else to reach for.
That conflates two things: how long the daemon may take to die, and
how long its stop script may run.

Give each hook a timeout of its own, defaulting to killdelay when
unset, so the existing behaviour is what you get until you ask for
something else.  parse_script() already falls back that way for the
hooks that had one.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-07-30 15:21:27 +02:00
1 parent 2a5190ecff
commit 53cb2b7bdb
2 files changed
+8 -6

No files matched your search

+2
View File
@@ -221,9 +221,11 @@ typedef struct svc {
/* When set, used instead of SIGHUP or stop-start */
char reload_script[MAX_CMD_LEN];
int reload_tmo;
/* When set, used instead of SIGTERM or sysv 'stop' */
char stop_script[MAX_CMD_LEN];
int stop_tmo;
/*
* Used to forcefully kill services that won't shutdown on