Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Best way to prevent zombie processes Date: Mon, 01 Jun 2015 13:25:21 +0300 Organization: A noiseless patient Spider Lines: 20 Message-ID: <87vbf7914e.fsf@elektro.pacujo.net> References: <87vbf8l9e7.fsf@Equus.decebal.nl> <87vbf88k0n.fsf@elektro.pacujo.net> <87mw0jlr8u.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="21627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YKeYQBpemrpYxEPqnNpGN" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:b5YXFLbOK00mCmWfsnq9otEzvZ0= sha1:UL1AwtX8rdsBYv1EsCnW9pUsefU= Xref: csiph.com comp.lang.python:91648 Cecil Westerhof : > It works. What I find kind of strange because > https://docs.python.org/2/library/signal.html You should not rely on Python documentation on Linux system specifics. The wait(2) manual page states: POSIX.1-2001 specifies that if the disposition of SIGCHLD is set to SIG_IGN or the SA_NOCLDWAIT flag is set for SIGCHLD (see sigaction(2)), then children that terminate do not become zombies and a call to wait() or waitpid() will block until all children have terminated, and then fail with errno set to ECHILD. (The original POSIX standard left the behavior of setting SIGCHLD to SIG_IGN unspecified. Note that even though the default disposition of SIGCHLD is "ignore", explicitly setting the disposition to SIG_IGN results in different treatment of zombie process children.) Marko