mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00:00
Only restart daemons when getting SIGCONT after SIGSTOP
Fix `restart_any_lost_procs()`, called when finit recovers from being stopped for a while. This function should not restart task/run/inetd services when called -- must check for type `SVC_CMD_SERVICE` when iterating over all registered `svc_t`, just like a regular lost pid. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
71ac8bb802
commit
12c470667f
2 files changed
+6
-5
No files matched your search
@@ -31,8 +31,6 @@ General
|
|||||||
* Move `finit.conf` "check" command to plugin which checks `/etc/fstab`
|
* Move `finit.conf` "check" command to plugin which checks `/etc/fstab`
|
||||||
instead. This is the de-facto practice. But keep the check command
|
instead. This is the de-facto practice. But keep the check command
|
||||||
for really low-end systems w/o `/etc/fstab`.
|
for really low-end systems w/o `/etc/fstab`.
|
||||||
* Fix `restart_any_lost_procs()`, currently it restarts task/run when
|
|
||||||
called -- must check `SVC_CMD_SERVICE`, like `svc_monitor()` does.
|
|
||||||
|
|
||||||
|
|
||||||
Init
|
Init
|
||||||
|
|||||||
@@ -481,12 +481,15 @@ static void restart_any_lost_procs(void)
|
|||||||
svc_t *svc;
|
svc_t *svc;
|
||||||
|
|
||||||
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
|
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
|
||||||
if (svc->type == SVC_CMD_INETD)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (svc->pid > 0 && pid_alive(svc->pid))
|
if (svc->pid > 0 && pid_alive(svc->pid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Only restart lost daemons, not task/run/inetd services */
|
||||||
|
if (SVC_CMD_SERVICE != svc->type) {
|
||||||
|
svc->pid = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
svc_start(svc);
|
svc_start(svc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user