Allow changing restart + oncrash settings of existing services

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-06-12 22:48:12 +02:00
parent f8dfcdf024
commit 561c88a868
+3 -4
View File
@@ -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)) {