diff --git a/TODO.md b/TODO.md index 5c8a4238..76b71f18 100644 --- a/TODO.md +++ b/TODO.md @@ -31,8 +31,6 @@ General * Move `finit.conf` "check" command to plugin which checks `/etc/fstab` instead. This is the de-facto practice. But keep the check command 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 diff --git a/svc.c b/svc.c index e615b464..0873ef09 100644 --- a/svc.c +++ b/svc.c @@ -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); } }