From owner-freebsd-questions@FreeBSD.ORG Thu May 22 15:40:21 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00D7437B404 for ; Thu, 22 May 2003 15:40:21 -0700 (PDT) Received: from adsl-64-161-78-226.dsl.lsan03.pacbell.net (adsl-64-161-78-226.dsl.lsan03.pacbell.net [64.161.78.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 48F7943F85 for ; Thu, 22 May 2003 15:40:20 -0700 (PDT) (envelope-from oremanj@adsl-64-161-78-226.dsl.lsan03.pacbell.net) Received: (qmail 18042 invoked by uid 1001); 22 May 2003 22:41:26 -0000 Date: Thu, 22 May 2003 15:41:26 -0700 From: Joshua Oreman To: Chuck Swiger Message-ID: <20030522224126.GB17789@webserver.get-linux.org> References: <4306.192.168.1.155.1053612014.squirrel@vipersystems.biz> <3ECCFDCF.4020103@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ECCFDCF.4020103@mac.com> User-Agent: Mutt/1.4i cc: questions@freebsd.org Subject: Re: Zombie Process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 22:40:21 -0000 On Thu, May 22, 2003 at 12:41:51PM -0400 or thereabouts, Chuck Swiger seemed to write: > Jason Lieurance wrote: > [ ... ] > > Zombie processes are mostly harmless: they are a process which has > finished and is sticking around because their parent hasn't reaped their > exit status. Have the parent process do a wait()... NOTE: This email is intended for if you really, truly, want to get rid of those zombies. These procedures are untested, but they should work :-) Do `ps ax` and find the PID of the child. Then this: $ ps axo ppid -p | grep -v PPID | sed 's/ //g' It will show the PID of the parent. From now on, this will be referred to as the-ppid. Now: $ which `ps axo command -p | grep -v COMMAND | cut -d' ' -f1` It will give you the program - if not, try and find it yourself. This will be called /path/to/the/program. The PID of the child will be called the-pid. Now `debug' the parent program and call wait(): $ gdb /path/to/the/program the-ppid [...] (gdb) call wait(the-pid) If it takes very long here, hit ^C. (gdb) quit The program is running. Quit anyway (and detach it)? yes $ kill -CONT the-ppid The zombie should've disappeared if you didn't have to press ^C; if you did, just don't worry about it. HTH, -- Josh > > -Chuck > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"