From 91550c926ba5705d30c00911564363e72bcd992d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 2 Jan 2022 07:13:06 +0100 Subject: [PATCH] Follow-up to ec2900e: use restart_sec:SEC as canonical option name A timeout is not the same as a restart delay, which this option really controls, but the name restart_delay is a bit too long. Hence, this obvious name so there's no ambiguity what unit we're dealing with. Keeping restarttmo:SEC as a compatibility setting for the benefit of the original authors, for now. Signed-off-by: Joachim Wiberg --- src/service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index fc2ea3cc..576fce67 100644 --- a/src/service.c +++ b/src/service.c @@ -1203,8 +1203,10 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) manual = 1; else if (!strncasecmp(cmd, "restart:", 8)) restart_max = atoi(&cmd[8]); - else if (!strncasecmp(cmd, "restarttmo:", 11)) + else if (!strncasecmp(cmd, "restarttmo:", 11)) /* compat alias */ restart_tmo = atoi(&cmd[11]) * 1000; + else if (!strncasecmp(cmd, "restart_sec:", 12)) + restart_tmo = atoi(&cmd[12]) * 1000; else if (!strncasecmp(cmd, "norestart", 9)) restart_max = 0; else if (!strncasecmp(cmd, "oncrash:", 8)) {