initctl: show the restart delay of a service with restart-max-sec

With restart-max-sec the delay before the next restart varies, and
nothing showed what it was or how far it could grow.

Show both in initctl status, for a service that has the setting:

       Restarts : 7 (4/-1)
     Restart in : 160 sec (max 300)

Add the D-Bus properties RestartDelay and RestartDelayMax for it, so
the status is the same when initctl goes over D-Bus.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-19 20:39:43 +01:00
1 parent 7f652770e3
commit 308287923d
6 files changed
+30 -2

No files matched your search

+11 -1
View File
@@ -186,7 +186,8 @@ following settings are available:
restart is at once, then after 2, 4, 8 seconds, and so on. A service
that stays up longer than the current delay is restarted after
`restart-sec` the next time it crashes, and the delay comes down
again the longer the service keeps running. Useful with
again the longer the service keeps running. `initctl status NAME`
shows the current delay and the limit, see below. Useful with
`restart = "always"`, for a service that should be retried forever,
only less and less often
* `restart = "always"` -- no upper limit on the number of times Finit
@@ -208,6 +209,15 @@ following settings are available:
* `oncrash = "script"` -- similarly, but instead of rebooting, call
the `exec-stop-post` script with exit code `crashed`, see below
With `restart-max-sec` set, `initctl status` shows the delay before the
next restart and its limit, here for a service that has crashed four
times in a row:
$ initctl status dialer
...
Restarts : 7 (4/-1)
Restart in : 160 sec (max 300)
Service directories
-------------------