Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zsh scripts leave defunct processes when running under docker exec



On Sun, 15 Feb 2015 22:03:05 +0800
Soares Chen <soares.chen@xxxxxxxxx> wrote:
> I have talked to people at Docker. From my understanding, Linux has a
> feature called subreaper that can take over the role of init and
> become the parent of orphaned descendant processes. In this case  on
> top of having different PID namespaces, `docker exec` is spawning a
> process called nsenter to act as the subreaper. It is responsible to
> reap defunct processes by handling SIGCHLD. With it being the
> subreaper, all orphaned/defunct processes are captured by nsenter
> instead of propogating to the actual init process inside the
> container.
> 
> So current Docker didn't handle SIGCHLD properly and therefore causing
> all orphaned processes to become defunct. It is probably not a problem
> of zsh, just that its way of implicitly exec and orphaning child
> processes in the final command causing this bug to become obvious in
> Docker.

Sounds entirely possible.  Thanks for tracking that down, it's very
useful to know.

pws



Messages sorted by: Reverse Date, Date, Thread, Author