service: save the configured restart delay when registering

The configured restart delay was saved at the first restart, when the
restart counter went from zero to one, and restored when a restart
succeeded.  The counter ages back to zero while the service runs.  If
it did so right after a restart and the service crashed again, the
back-off delay was saved over the configured one.  From then on the
first restart after a crash waited two or five seconds, until the next
reload.

Save it once, when the service is registered.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-19 20:39:41 +01:00
1 parent 644279cd72
commit bba286036e
2 files changed
+3 -2

No files matched your search

+2
View File
@@ -188,6 +188,8 @@ All relevant changes are documented in this file.
- Fix a command whose name starts like a service option, e.g. `logger` or
`pidof`. It was taken as the `log` or `pid` option and the next argument
ran as the command, which also broke the `logger` example in finit.conf(5)
- Fix the delay before the first restart of a crashing service, it could
grow to the back-off delay and stay there until the next reload
- Fix the restart counter of a service with `restart = "always"`, nothing
stopped it and it overflowed after 127 restarts, 255 on Arm. It now
stops at 10, where the back-off has long since peaked, and ages from