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:
Joachim Nilsson committed 2015-02-26 16:55:15 +01:00
1 parent 71ac8bb802
commit 12c470667f
2 files changed
+6 -5

No files matched your search

+6 -3
View File
@@ -481,12 +481,15 @@ static void restart_any_lost_procs(void)
svc_t *svc;
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))
continue;
/* Only restart lost daemons, not task/run/inetd services */
if (SVC_CMD_SERVICE != svc->type) {
svc->pid = 0;
continue;
}
svc_start(svc);
}
}