From 85a212ef932ca46382ddbaf12faa628d0b5498ca Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 14 Apr 2021 16:23:22 +0200 Subject: [PATCH] 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 --- src/service.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/service.c b/src/service.c index 5c1ed08b..6d88a90c 100644 --- a/src/service.c +++ b/src/service.c @@ -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 */