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

+2
View File
@@ -187,6 +187,8 @@ All read-only; observable via `Properties.Get` and `Properties.GetAll`.
| `ExitStatus` | `u` | Raw `waitpid(2)` status from the last exit |
| `RestartsTotal` | `u` | Restarts over the service's lifetime |
| `RestartMax` | `u` | Restart limit before the service is blocked |
| `RestartDelay` | `u` | Seconds before the next restart, should the service crash |
| `RestartDelayMax` | `u` | The `restart-max-sec` setting, 0 when not set |
| `Starts` | `u` | Times started, for `manual-start` units |
| `ManualStart` | `b` | `manual-start` set in the `.conf` |
| `Forking` | `b` | Daemon forks to background |