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

+1 -1
View File
@@ -1668,7 +1668,7 @@ static void svc_translate(cfg_t *sec, int type, struct rlimit rlimit[], char *fi
}
if (sec_getint(sec, "restart-sec", NULL, &num))
addtok(line, sizeof(line), "restart_sec:%ld", num);
addtok(line, sizeof(line), "restart-sec:%ld", num);
if (sec_getint(sec, "restart-max-sec", NULL, &num))
addtok(line, sizeof(line), "restart-max-sec:%ld", num);
+3 -3
View File
@@ -2396,9 +2396,9 @@ svc_t *service_register_desc(int type, char *cfg, const char *desc,
else
restart_max = atoi(arg);
}
else if (MATCH_CMD(cmd, "restarttmo:", arg)) /* compat alias */
restart_tmo = atoi(arg) * 1000;
else if (MATCH_CMD(cmd, "restart_sec:", arg))
else if (MATCH_CMD(cmd, "restart-sec:", arg) ||
MATCH_CMD(cmd, "restart_sec:", arg) || /* compat alias */
MATCH_CMD(cmd, "restarttmo:", arg)) /* compat alias */
restart_tmo = atoi(arg) * 1000;
else if (MATCH_CMD(cmd, "restart-max-sec:", arg)) {
const char *errstr;