mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Allow changing restart + oncrash settings of existing services
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f8dfcdf024
commit
561c88a868
1 file changed
+3
-4
+3
-4
@@ -1373,10 +1373,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
|||||||
|
|
||||||
if (type == SVC_TYPE_SERVICE && manual)
|
if (type == SVC_TYPE_SERVICE && manual)
|
||||||
svc_stop(svc);
|
svc_stop(svc);
|
||||||
|
|
||||||
svc->restart_max = restart_max;
|
|
||||||
svc->restart_tmo = restart_tmo;
|
|
||||||
svc->oncrash_action = oncrash_action;
|
|
||||||
} else {
|
} else {
|
||||||
_d("Found existing svc for %s name %s id %s type %d", cmd, name, id, type);
|
_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));
|
strlcpy(svc->file, file, sizeof(svc->file));
|
||||||
svc->respawn = respawn;
|
svc->respawn = respawn;
|
||||||
svc->forking = forking;
|
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 */
|
/* Decode any (optional) pid:/optional/path/to/file.pid */
|
||||||
if (svc_is_daemon(svc) || svc_is_sysv(svc)) {
|
if (svc_is_daemon(svc) || svc_is_sysv(svc)) {
|
||||||
|
|||||||
Reference in new issue
Block a user