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

+17
View File
@@ -32,6 +32,16 @@ CONF
run "initctl reload"
}
# Same, with the line-based format, options in $1
crash_line()
{
run "rm -f $FINIT_CONF"
run "initctl reload"
run "rm -f $STARTS"
run "echo 'service $1 crash.sh -- Crashing' > $FINIT_CONF"
run "initctl reload"
}
test_teardown()
{
say "Running test teardown."
@@ -67,3 +77,10 @@ assert_delay 4 5 4 5
say 'The restart counter stops where the delay peaks'
assert "Restart counter is 2" "$(texec initctl status crash | awk '/Restarts/{ print $4 }')" = "(2/-1)"
sep
say 'restart-sec in the line-based format, and its old spelling'
crash_line 'restart:always restart-sec:3'
assert_delay 1 2 3 4
crash_line 'restart:always restart_sec:3'
assert_delay 1 2 3 4