mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
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:
6 files changed
+34
-11
No files matched your search
+1
-1
@@ -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
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user