From owner-freebsd-questions Sun Nov 19 19:24:17 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA03152 for questions-outgoing; Sun, 19 Nov 1995 19:24:17 -0800 Received: from kryten.atinc.com (kryten.Atinc.COM [198.138.38.7]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id TAA03147 for ; Sun, 19 Nov 1995 19:24:10 -0800 Received: (jmb@localhost) by kryten.atinc.com (8.6.9/8.3) id WAA02548; Sun, 19 Nov 1995 22:14:55 -0500 Date: Sun, 19 Nov 1995 22:14:54 -0500 (EST) From: "Jonathan M. Bresler" Subject: Re: Cap'n, there be Zombies here! To: Randy Berndt cc: Terry Lambert , freebsd-questions@FreeBSD.ORG In-Reply-To: <199511200300.VAA26624@vellocet.insync.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.ORG Precedence: bulk On Sun, 19 Nov 1995, Randy Berndt wrote: > Thanks for the quick reply. No, I'm not reaping (reaping?). I have LIMITED > experience with the signal() facility. The man page for signal says the > default action is 'ignore' for SIGCHLD. Should I set up something that says: > > (void) signal(SIGCHLD, throw_away) > > void throw_away() > { > } > > in the part that sets up the fork. if you set the signal behavior to SIG_IGN, zombies are never created. the kernel "knows" that the parent will never request the exit status of the child and so discards that exit status. > > Also, it is not clear to me if 'execlp' waits for completion before continuing. > If it does not, maybe the SIGCHLD is coming from execlp to the process that > quit before it did. execlp never returns. the running process is replaced by the exec'ed process. this is true for all the execxxx() system calls. if you fork() and the child then calls execxxx() either the child or the parent may run to completion first. if the parent completes and exits first, the child is inherited by the init process. if the child complete and tries to exit, it will become a zombie until the parent calls one of the waitxx() system calls. Jonathan M. Bresler jmb@kryten.atinc.com | Analysis & Technology, Inc. FreeBSD Postmaster jmb@FreeBSD.Org | 2341 Jeff Davis Hwy play go. | Arlington, VA 22202 ride bike. hack FreeBSD.--ah the good life | 703-418-2800 x346