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

Laurent Bercot ska-dietlibc at skarnet.org
Mon Jan 8 18:53:19 UTC 2018


>How about this:

  IIUC, this changes init's behaviour to only sleep after it has just
started a direct child, so as long as the /etc/inittab processes are
stable, it will always reap distant orphans instantly; but it will
still wait for 1 second before reaping a batch of processes that died
at the same time it spawned a getty or something.

  Am I correct in my understanding?

  If I am: this reduces the number of cases where the window is hit,
so it will certainly help; zombies will only be observable in some
corner cases. However, this does not eliminate the behaviour
entirely, it only makes it more rare - and more obscure. You _know_ that
at some point someone is going to hit it and will get headaches trying
to understand what is happening.

  I have no strong opinion on whether this is an overall improvement or
not. It probably is, because /etc/inittab processes do not change often,
so it makes the window really tiny.

  If you're not willing to go the (best, but more complex) route of
maintaining a separate minimal respawn date for each of init's direct
children and restructuring the reaper loop, I think the most important
improvement would be a comment in init.c explaining why the zombie
apocalypse may happen in what circumstances, and that it will only last
one second.

--
  Laurent



More information about the busybox mailing list