From owner-freebsd-stable@FreeBSD.ORG Thu Jan 20 17:27:50 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 0DDB816A4CF for ; Thu, 20 Jan 2005 17:27:50 +0000 (GMT) Received: from postal3.es.net (postal3.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id D534843D4C for ; Thu, 20 Jan 2005 17:27:49 +0000 (GMT) (envelope-from oberman@es.net) Received: from ptavv.es.net ([198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP (SSL) id IBA74465; Thu, 20 Jan 2005 09:27:49 -0800 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id 5038C5D08; Thu, 20 Jan 2005 09:27:48 -0800 (PST) To: spam maps In-reply-to: Your message of "Thu, 20 Jan 2005 02:06:38 PST." <20050120100638.88174.qmail@web54002.mail.yahoo.com> Date: Thu, 20 Jan 2005 09:27:48 -0800 From: "Kevin Oberman" Message-Id: <20050120172748.5038C5D08@ptavv.es.net> 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 17:27:50 -0000 > Date: Thu, 20 Jan 2005 02:06:38 -0800 (PST) > From: spam maps > Sender: owner-freebsd-stable@freebsd.org > > 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? FreeBSD is an operating system, not a kernel like Linux. Both cron and ssh are part of FreeBSD. That said, the problem could be in sh or in the program executed, too. I trivial note: -f implies -n. There is no need to specify both, but no harm in doing so. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634