mirror of
https://github.com/troglobit/finit.git
synced 2026-10-09 16:50:59 +07:00
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:
+3
-2
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user