mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Backport two fixes addressing a critical failure reported by a customer:
an unclean dbus-daemon exit leaves a lingering /run/messagebus.pid, the
daemon then refuse to start, and Finit's restart loop gives up.
0001 service: clean stale pidfile after unclean daemon exit
Drop a daemon-owned (pid:!) pidfile when it still names the
just-reaped PID and that PID is no longer alive.
0002 service: log signal name and core dumps in death message
"by signal: 9" -> "killed by SIGKILL", with ", core dumped"
when applicable. Stronger breadcrumb for sudden deaths.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
51 lines
2.1 KiB
Diff
51 lines
2.1 KiB
Diff
From 30f2ca3b2e64bce7db1e2d9dcb37a06d53e0b6bf Mon Sep 17 00:00:00 2001
|
|
From: Joachim Wiberg <troglobit@gmail.com>
|
|
Date: Mon, 11 May 2026 17:08:25 +0200
|
|
Subject: [PATCH 2/2] service: log signal name and core dumps in death message
|
|
Organization: Wires
|
|
|
|
Replace the bare signal number ("by signal: 9") with the symbolic
|
|
name ("killed by SIGKILL") and annotate when the kernel wrote a
|
|
core:("killed by SIGSEGV, core dumped"). Makes the restart line
|
|
self-explanatory and gives operators a strong breadcrumb when a
|
|
daemon dies unexpectedly.
|
|
|
|
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
|
---
|
|
src/service.c | 19 ++++++++++++-------
|
|
1 file changed, 12 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/service.c b/src/service.c
|
|
index e930c4fd..127e0099 100644
|
|
--- a/src/service.c
|
|
+++ b/src/service.c
|
|
@@ -2828,13 +2828,18 @@ static void service_retry(svc_t *svc)
|
|
timeout = ((*restart_cnt) <= (svc->restart_max / 2)) ? 2000 : 5000;
|
|
/* If a longer timeout was specified in the conf, use that instead. */
|
|
svc->restart_tmo = max(svc->restart_tmo, timeout);
|
|
- logit(LOG_CONSOLE|LOG_WARNING, "Service %s[%d] died (%s%d), restarting (retry in %d msec) (attempt: %d/%d)",
|
|
- svc_ident(svc, NULL, 0), svc->oldpid,
|
|
- WIFEXITED(svc->status) ? "with exit status: " : "by signal: ",
|
|
- WIFEXITED(svc->status) ? WEXITSTATUS(svc->status) : WTERMSIG(svc->status),
|
|
- svc->restart_tmo,
|
|
- *restart_cnt,
|
|
- svc->restart_max);
|
|
+ if (WIFEXITED(svc->status))
|
|
+ logit(LOG_CONSOLE|LOG_WARNING,
|
|
+ "Service %s[%d] died (exit status: %d), restarting (retry in %d msec) (attempt: %d/%d)",
|
|
+ svc_ident(svc, NULL, 0), svc->oldpid, WEXITSTATUS(svc->status),
|
|
+ svc->restart_tmo, *restart_cnt, svc->restart_max);
|
|
+ else
|
|
+ logit(LOG_CONSOLE|LOG_WARNING,
|
|
+ "Service %s[%d] died (killed by %s%s), restarting (retry in %d msec) (attempt: %d/%d)",
|
|
+ svc_ident(svc, NULL, 0), svc->oldpid,
|
|
+ sig_name(WTERMSIG(svc->status)),
|
|
+ WCOREDUMP(svc->status) ? ", core dumped" : "",
|
|
+ svc->restart_tmo, *restart_cnt, svc->restart_max);
|
|
|
|
svc_unblock(svc);
|
|
service_step(svc);
|
|
--
|
|
2.43.0
|
|
|