From b695b46a9d99ce1852cc0144951da986e293d1c8 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 18 Mar 2025 07:18:16 +0100 Subject: [PATCH] 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 --- src/service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service.c b/src/service.c index 85cc0b09..38ea58cd 100644 --- a/src/service.c +++ b/src/service.c @@ -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)