[PATCH] zombie processes (maybe was: init does not kill reparented processes)

Harald Küthe harald-tuxbox at arcor.de
Thu Jan 3 23:58:30 UTC 2008


Hello list,
There exists a patch which is hanging around in our development tree for
ages now which we used to avoid zombie processes.
This is maybe related to some old stuff found here:
http://www.busybox.net/lists/busybox/2004-August/012422.html
Our inittab calls a startscript which is not ended during runtime, but
only when the settopbox shuts down.

If you are interested, here's the patch.
ppc8xx/linux-2.4.35/libc-2.3.6/gcc-3.4.6.

Best regards
Harald

diff -Naur busybox-1.9.0/init/init.c busybox-1.9.0-dbox2/init/init.c
--- busybox-1.9.0/init/init.c   2007-12-21 23:00:32.000000000 +0100
+++ busybox-1.9.0-dbox2/init/init.c     2008-01-03 23:35:45.000000000 +0000
@@ -497,10 +497,12 @@
     int status, wpid;

     while (1) {
-        wpid = waitpid(runpid, &status, 0);
-        if (wpid == -1 && errno == EINTR)
+        wpid = wait(&status);
+        if (wpid >0 && wpid != runpid) {
             continue;
-        break;
+        }
+        if (wpid == runpid)
+            break;
     }
     return wpid;
}





More information about the busybox mailing list