Docker and the PID 1 zombie reaping problem (2015)

  • If only there were some mechanism in Unix that could be used for transferring data. If only that mechanism could somehow record which processes were using the resources in question! Then child processes could be integrated with that system somehow, such that their exit code (or other matters of interest) could be transferred through this conduit. And when all users of the resource had indicated they were no longer interested, the child process could be discarded - or, if still running, not then become a zombie when it finishes.

    The current situation is suboptimal, I claim. But it's true that with no convenient standard abstraction for transferring data, we don't really have any other conceivable option.

  • Well, we have things like minit, you know. https://github.com/chazomaticus/minit

  • (2015)

  • or... you could use LXC instead?

  • Maybe Docker stinks?

    > lxc-execute command will run the specified command into the container via an intermediate process, lxc-init. This lxc-init after launching the specified command, will wait for its end and all other reparented processes. (to support daemons in the container). In other words, in the container, lxc-init has the pid 1 and the first process of the application has the pid 2.

    https://linuxcontainers.org/fr/lxc/manpages/man7/lxc.7.html