From 561c88a868206e829b56f2c3db11f7eb298fd0a0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 12 Jun 2022 22:44:31 +0200 Subject: [PATCH] Allow changing restart + oncrash settings of existing services Signed-off-by: Joachim Wiberg --- src/service.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/service.c b/src/service.c index 8dd8a88a..5ba39f4c 100644 --- a/src/service.c +++ b/src/service.c @@ -1373,10 +1373,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) if (type == SVC_TYPE_SERVICE && manual) svc_stop(svc); - - svc->restart_max = restart_max; - svc->restart_tmo = restart_tmo; - svc->oncrash_action = oncrash_action; } else { _d("Found existing svc for %s name %s id %s type %d", cmd, name, id, type); @@ -1466,6 +1462,9 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) strlcpy(svc->file, file, sizeof(svc->file)); svc->respawn = respawn; svc->forking = forking; + svc->restart_max = restart_max; + svc->restart_tmo = restart_tmo; + svc->oncrash_action = oncrash_action; /* Decode any (optional) pid:/optional/path/to/file.pid */ if (svc_is_daemon(svc) || svc_is_sysv(svc)) {