service: spell the restart_sec: option restart-sec:

restart_sec: was the only setting in snake_case.  Every other option
of the line-based format is in kebab-case, and so is the block format,
restart-sec = SEC.

Take restart-sec: and keep restart_sec: as an alias, so a .conf from
an older Finit loads as before:

    service restart-sec:10 foo -- Foo daemon

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-19 20:39:42 +01:00
1 parent 62bd5f4892
commit aae640b8f3
6 files changed
+34 -11

No files matched your search

+7 -5
View File
@@ -379,18 +379,20 @@ marked
.Em crashed
and must be restarted manually with
.Xr initctl 8 .
.It Cm restart_sec:SEC
.It Cm restart-sec:SEC
number of seconds before Finit tries to restart
a crashing service, default: 2 seconds for the first five retries,
then back-off to 5 seconds. The maximum of this configured value
and the above (2 and 5) will be used
and the above (2 and 5) will be used. The old spelling,
.Cm restart_sec:SEC ,
is still accepted
.It Cm restart-max-sec:SEC
replaces that back-off with a delay that doubles for each restart, from
.Cm restart_sec
.Cm restart-sec
up to this limit, e.g. 10, 20, 40, and so on up to 300 seconds with
.Cm restart_sec:10 restart-max-sec:300 .
.Cm restart-sec:10 restart-max-sec:300 .
Without
.Cm restart_sec
.Cm restart-sec
the first restart is at once, then after 2, 4, 8 seconds. The delay
comes down again as the service keeps running
.It Cm restart:always