As reported by Quy Tonthat, init has problems with inittab's that
authorEric Andersen <andersen@codepoet.org>
Mon, 12 Apr 2004 19:17:13 +0000 (19:17 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 12 Apr 2004 19:17:13 +0000 (19:17 -0000)
contain only actions sysinit/wait/once. It does not clean up zombies
in that case.

init/init.c

index ae2fd4c3aafb707be02f9e4146adf0760df506d0..fd1443e4455e5bf6ae3844bacaa5eff89c34106e 100644 (file)
@@ -1144,13 +1144,6 @@ extern int init_main(int argc, char **argv)
        /* Next run anything to be run only once */
        run_actions(ONCE);
 
-       /* If there is nothing else to do, stop */
-       if (init_action_list == NULL) {
-               message(LOG | CONSOLE,
-                               "No more tasks for init -- sleeping forever.");
-               loop_forever();
-       }
-
        /* Redefine SIGHUP to reread /etc/inittab */
        signal(SIGHUP, reload_signal);
 
@@ -1167,7 +1160,7 @@ extern int init_main(int argc, char **argv)
 
                /* Wait for a child process to exit */
                wpid = wait(&status);
-               while (wpid > 0) {
+               while (init_action_list && wpid > 0) {
                        /* Find out who died and clean up their corpse */
                        for (a = init_action_list; a; a = a->next) {
                                if (a->pid == wpid) {