service: do not let a script timeout take PID 1 with it

A stop: or reload: script written with a timeout killed Finit at
config load:

    service stop:5,/bin/true service.sh -- Boom

parse_script() takes the timeout as a pointer and the caller decides
whether it wants one.  However, both stop: and reload: scripts so far
have no timeout, i.e., NULL.  Guard the branch that reads a leading
number.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-07-30 14:16:50 +02:00
1 parent e0f9df1f27
commit dd77f63ad3
3 files changed
+40 -2

No files matched your search

+2 -1
View File
@@ -1654,7 +1654,8 @@ static void parse_script(svc_t *svc, char *type, char *script, int *tmo, char *b
script, errstr);
goto err;
}
*tmo = (int)(sec * 1000);
if (tmo)
*tmo = (int)(sec * 1000);
} else {
path = script;
if (tmo)