From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9384 invoked by alias); 15 Feb 2015 18:21:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34548 Received: (qmail 13114 invoked from network); 15 Feb 2015 18:20:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.153.127] X-Spam: 0 X-Authority: v=2.1 cv=VLdTnr/X c=1 sm=1 tr=0 a=39NrsSuza2clQiZR/7fYWQ==:117 a=39NrsSuza2clQiZR/7fYWQ==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=pGLkceISAAAA:8 a=62SDsdWj0bbVUcv1TPgA:9 a=CjuIK1q_8ugA:10 Date: Sun, 15 Feb 2015 18:20:48 +0000 From: Peter Stephenson To: Soares Chen , zsh-workers@zsh.org Subject: Re: Zsh scripts leave defunct processes when running under docker exec Message-ID: <20150215182048.6ae1f637@ntlworld.com> In-Reply-To: References: <20150211101130.2ac4d9b5@pwslap01u.europe.root.pri> <150211081345.ZM17542@torch.brasslantern.com> <20150213103919.GD1848@tarsus.local2> <150214105834.ZM4462@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 15 Feb 2015 22:03:05 +0800 Soares Chen 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