From owner-freebsd-stable@FreeBSD.ORG Wed Jan 19 07:40: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 983B116A4CE for ; Wed, 19 Jan 2005 07:40:29 +0000 (GMT) Received: from oslex.fast.no (pat-gw.osl.fast.no [217.144.235.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80DEF43D41 for ; Wed, 19 Jan 2005 07:40:28 +0000 (GMT) (envelope-from Raymond.Wiker@fast.no) Received: from raw.grenland.fast.no.fast.no ([192.168.48.104] RDNS failed) by oslex.fast.no with Microsoft SMTPSVC(6.0.3790.211); Wed, 19 Jan 2005 08:40:26 +0100 From: Raymond Wiker MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16878.3817.600151.965257@raw.grenland.fast.no> Date: Wed, 19 Jan 2005 08:40:25 +0100 To: freebsd-stable@freebsd.org In-Reply-To: <20050119064822.GA65506@cirb503493.alcatel.com.au> References: <41EDA6FB.6000706@snu.ac.kr> <20050119064822.GA65506@cirb503493.alcatel.com.au> X-Mailer: VM 7.17 under 21.4 (patch 14) "Reasonable Discussion" XEmacs Lucid X-OriginalArrivalTime: 19 Jan 2005 07:40:26.0666 (UTC) FILETIME=[2458B0A0:01C4FDFA] 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: Wed, 19 Jan 2005 07:40:29 -0000 Peter Jeremy writes: > On Wed, 2005-Jan-19 09:16:59 +0900, Rob Lahaye wrote: > > tunnel="-L 55110:localhost:110 pop3.univ.net" > > tunnel_up=`pgrep -f -- "${tunnel}"` > > [ "${tunnel_up}" = "" ] && /usr/bin/ssh -N -f ${tunnel} > > >It works beautifully, but why does this also generate one zombie process: > > USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND > > rob 655 0.0 0.0 0 0 ?? Z Sat02PM 0:00.01 > > You get a zombie when a process has exited and the parent hasn't issued > a wait(2) (or SIG_IGN'd SIGCHLD). Have a look at what the parent process > is and that might give you an idea as to what is going wrong. Ancient Perl did not collect for children started via the backtick operator - is this a possible issue for /bin/sh as well? It should be harmless to call wait just after the use of the backtick operator above; does that change anything? I.e: tunnel_up=`pgrep -f -- "${tunnel}"`; wait To see the parent pid, add "-O ppid" to the arguments to ps; e.g, ps axww -O ppid -- Raymond Wiker Mail: Raymond.Wiker@fast.no Senior Software Engineer Web: http://www.fast.no/ Fast Search & Transfer ASA Phone: +47 23 01 11 60 P.O. Box 1677 Vika Fax: +47 35 54 87 99 NO-0120 Oslo, NORWAY Mob: +47 48 01 11 60