Fix kill() on timeout of pre:/post:/ready:scripts

A long running pre/post/ready script must be killed properly, not by
targeting its process group.  Process group cleanup is handled by the
service_monitor() when reaping the script's PID.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-02-11 10:17:34 +01:00
parent 9d8a9b7fba
commit 990307fbc9
+3 -2
View File
@@ -150,7 +150,7 @@ static void service_script_kill(svc_t *svc)
continue;
dbg("Killing service %s script PID %d.", svc_ident(svc, NULL, 0), ptr->pid);
kill(-ptr->pid, SIGKILL);
kill(ptr->pid, SIGKILL);
TAILQ_REMOVE(&svc_assoc_list, ptr, link);
free(ptr);
}
@@ -2086,7 +2086,8 @@ static void service_kill_script(svc_t *svc)
if (svc->pid <= 1)
return;
kill(-svc->pid, SIGKILL);
dbg("Timeout, killing service %s script PID %d", svc_ident(svc, NULL, 0), svc->pid);
kill(svc->pid, SIGKILL);
}
/*