Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 1998 10:07:47 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Dean Hollister <dean@odyssey.apana.org.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Wierd zombie process
Message-ID:  <19980518100747.G427@freebie.lemis.com>
In-Reply-To: <Pine.BSF.3.96.980517214436.18345B-100000@odyssey.apana.org.au>; from Dean Hollister on Sun, May 17, 1998 at 09:46:11PM %2B0800
References:  <Pine.BSF.3.96.980517214436.18345B-100000@odyssey.apana.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 17 May 1998 at 21:46:11 +0800, Dean Hollister wrote:
>
> Hiyall,
>
> Upon trying to clear a jammed line, look at this:
>
> bash$ ps -t /dev/cue3
>
>   PID  TT  STAT      TIME COMMAND
> 28294 cue- IEs    0:00.00  (bash)
> 28993 cue- Z      0:00.00  (sh)
>
> I cannot kill either process it would seem. A kill on the first one fails
> to result in an exit, whilst a kill on the second returns no such pid.
>
> Any ideas?

A zombie is a dead process whose parent is denying it a proper
burial.  Try the l option to ps:

$ ps lax | grep Z
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
 1004  3044  3025   3  -6  0   900  520 piperd S+    p7    0:00.01 grep Z
 1004   484   483   2  28  0     0    0 -      Z     v0    0:00.00  (rsh)

This shows that our zombie rsh (in this example) was spawned by (PPID)
process 483.  That's the delinquent parent you need to look at:

$ ps -p 483
  PID  TT  STAT      TIME COMMAND
  483  v0  I      0:00.02 rsh allegro xterm -name xterm-rsxa -bg "light yellow" -s -sl 256 -sb -ls -j -rw -display free
$ kill 483
$ ps p484
  PID  TT  STAT      TIME COMMAND
$ ps lax | grep Z
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
 1004  3051  3025   2  -6  0   900  520 piperd S+    p7    0:00.01 grep Z

In other words, you have the choice of killing the parent if that's
safe, or keeping the zombie.  In this example, which is relatively
common, the connection has been lost to the remote system, and for
some reason the rsh doesn't die.  It's perfectly safe to kill it.

Greg
--
See complete headers for address and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980518100747.G427>