Revert last part of 91a9c83, fallback SIGKILL when stopping services

When a service is stopped, but does not respond to the default SIGTERM,
a fallback kicks in after 3 seconds (default) to send SIGKILL.  Since
91a9c83 (v3.2-rc2) this has however not worked since the signal was
only sent to the process group.

It is the job of service_monitor(), when it reaps the process leader,
to forward the signal to the process group.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-03-18 07:18:16 +01:00
parent 0e61ed727f
commit b695b46a9d
+2 -2
View File
@@ -915,12 +915,12 @@ static void service_kill(svc_t *svc)
return;
}
dbg("%s: Sending SIGKILL to process group %d", nm, svc->pid);
dbg("%s: Sending SIGKILL to process %d", nm, svc->pid);
logit(LOG_CONSOLE | LOG_NOTICE, "Stopping %s[%d], sending SIGKILL ...", id, svc->pid);
if (runlevel != 1)
print_desc("Killing ", svc->desc);
kill(-svc->pid, SIGKILL);
kill(svc->pid, SIGKILL);
/* Let SIGKILLs stand out, show result as [WARN] */
if (runlevel != 1)