mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00: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:
1 file changed
+3
-2
+3
-2
@@ -150,7 +150,7 @@ static void service_script_kill(svc_t *svc)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
dbg("Killing service %s script PID %d.", svc_ident(svc, NULL, 0), ptr->pid);
|
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);
|
TAILQ_REMOVE(&svc_assoc_list, ptr, link);
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
@@ -2086,7 +2086,8 @@ static void service_kill_script(svc_t *svc)
|
|||||||
if (svc->pid <= 1)
|
if (svc->pid <= 1)
|
||||||
return;
|
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