From owner-freebsd-stable@FreeBSD.ORG Thu Jan 20 10:25:29 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0C6416A4CE for ; Thu, 20 Jan 2005 10:25:29 +0000 (GMT) Received: from nuumen.pair.com (nuumen.pair.com [209.68.1.119]) by mx1.FreeBSD.org (Postfix) with SMTP id 7669343D2F for ; Thu, 20 Jan 2005 10:25:29 +0000 (GMT) (envelope-from thuppi@nuumen.pair.com) Received: (qmail 99509 invoked by uid 55300); 20 Jan 2005 10:25:29 -0000 Date: Thu, 20 Jan 2005 05:25:28 -0500 (EST) From: Tom Huppi X-X-Sender: thuppi@nuumen.pair.com To: spam maps In-Reply-To: <20050120100638.88174.qmail@web54002.mail.yahoo.com> Message-ID: References: <20050120100638.88174.qmail@web54002.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-stable@freebsd.org Subject: Re: User's cron job creates zombie process on 5.3 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2005 10:25:30 -0000 On Thu, 20 Jan 2005, spam maps wrote: > Peter Jeremy wrote: > > On Wed, 2005-Jan-19 21:14:26 -0800, spam maps wrote: > > > >>> ( /usr/bin/ssh -n -f ${tunnel} & ) > >> > >>Alas, no success. Still get the zombie > >>process. > >> > >>I actually wonder if this is an odd or buggy > >>behaviour of ssh, or is cron making a mistake here? > > > > > > The cron daemon (which will have a PPID of 1) forks > > a copy of itself to actually handle the cron job > > (I suspect this is the parent of the zombie that > > you are seeing). This child process runs > > "/bin/sh -c CRONJOB" (where CRONJOB is the line in > > your crontab) and I suspect this is the zombie you > > are seeing. > > > > My guess is that your ssh process is holding open > > file descriptors and the cron child process is > > waiting for these descriptors to close before > > wait()ing for the child. If this is true, then you > > should avoid it with something like: > > ( /usr/bin/ssh -n -f ${tunnel} >/dev/null 2>&1 & ) > > > > BINGO! > That works. Zombie has gone. Thank you. > > >>Leaving a zombie process around, means there's a > kind > >>of bug/mistake somewhere, right? > > > > Yes. But it's not necessarily a bug in FreeBSD :-). > > So, after you've given me a complicated solution to > avoid the zombie, can you tell which program is at > error here? Cron, ssh, or FreeBSD? There are two other possibilities I could thing of off hand; Bourne Shell, or indeed, the 'program' (albeit a small one) which you wrote! My vote would be the latter. I vote that way because a change in the code (based on a good knowledge of the mechanics of the language and unix in general) made the problem go away. It's mainly a matter of perspective I guess :) Thanks, - Tom