Terminate children in the same process group when monitored PID dies

Really kill them, our monitored process may be about to restart, so we
don't want any unintended side effects from lingering children in prior
instances.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-24 23:43:03 +01:00
parent 14f0443bd7
commit d37c20f467
+1 -1
View File
@@ -1172,7 +1172,7 @@ void service_monitor(pid_t lost, int status)
}
/* Terminate any children in the same proess group, e.g. logit */
kill(-svc->pid, SIGTERM);
kill(-svc->pid, SIGKILL);
/* No longer running, update books. */
svc->start_time = svc->pid = 0;