[PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

Laurent Bercot ska-dietlibc at skarnet.org
Sun Jan 7 13:34:27 UTC 2018


>It depends whether you consider init to be required to reap zombies
>as fast as possible.
>
>I don't see that as a requirement (so far, feel free to convince
>me otherwise).

  I don't see it as a hard requirement either; I don't really mind having
zombies around for a few seconds, provided they eventually get reapt.

  However, most people are used to the sysvinit behaviour, and rely on
it. Few people are aware that bb init may wait for one second before
reaping zombies, because the window is not hit often, only bb init does
that, and bb init is not as common as other inits. So it's a
peculiarity that people do not plan for, and it may bite them.

  The javascript test I mentioned failed on Alpine Linux because it hit
the one second window; the test was incorrectly designed, but it worked
with basically every other init out there.
  The current thread's OP observed zombies when killing runsvdir, which
led him on a red herring chase, a misguided patch, and wasted time in
this thread.

  I'm personally not impacted, because I have my own pid 1 (s6-svscan)
which reaps zombies as soon as they happen; and stricto sensu, I don't
think bb init's behaviour is a bug. But changing it to mimic the
behaviour of all the other inits would certainly prevent similar
annoying, if minor, problems from arising in the future.

--
  Laurent



More information about the busybox mailing list