service_monitor(): cancel any pending SIGKILL timers

As soon as we collect a PID we should cancel any outstanding timer
actions.   Because we may very soon svc_del() it ...

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-04-14 16:29:19 +02:00
parent 12c3cb3dc0
commit 85a212ef93
+3
View File
@@ -654,6 +654,9 @@ static void service_cleanup(svc_t *svc)
logit(LOG_CRIT, "Failed removing service %s pidfile %s",
basename(svc->cmd), fn);
/* PID collected, cancel any pending SIGKILL */
service_timeout_cancel(svc);
/* No longer running, update books. */
if (svc_is_tty(svc) && svc->pid > 1)
utmp_set_dead(svc->pid); /* Set DEAD_PROCESS UTMP entry */