Question regarding runsvdir not reaping children.

Denys Vlasenko vda.linux at googlemail.com
Mon Dec 25 21:13:02 UTC 2017


On Fri, Dec 22, 2017 at 9:48 PM, Markus Gothe <nietzsche at lysator.liu.se> wrote:
> What is the rationale behind not reaping the children when the program
> exists? i run it from inittab as a respawn process and I get zombies when
> killing it when not reaping children alas the fix was pretty simple.

runsvdir does read any children:

        for (;;) {
                unsigned now;
                unsigned sig;

                /* collect children */
                for (;;) {
                        pid_t pid = wait_any_nohang(NULL);
                        if (pid <= 0)
                                break;
                        for (i = 0; i < svnum; i++) {
                                if (pid == sv[i].pid) {
                                        /* runsv has died */
                                        sv[i].pid = 0;
                                        need_rescan = 1;
                                }
                        }
                }


More information about the busybox mailing list