kill defunct processes

kill defunct processes

Post by Chri » Tue, 17 Sep 2002 17:42:55



Hi all,

Perhaps, this question has been asked before ....Sorry.
Running on E5500, Solaris 7.

We have 15 Zombies processes by using the top command ....
Is there a way to kill all these defunct processes without rebooting the
server ???? The kill command doesn't work.

Thanks.

Chris.

 
 
 

kill defunct processes

Post by Anthony Mandi » Tue, 17 Sep 2002 18:17:51



> We have 15 Zombies processes by using the top command ....
> Is there a way to kill all these defunct processes without rebooting the
> server ???? The kill command doesn't work.

        That's because they are already dead. The correct fix is to
        fix the calling process to reap them when they exit.

-am     ? 2002

 
 
 

kill defunct processes

Post by Peter Schmit » Tue, 17 Sep 2002 18:42:27



> Perhaps, this question has been asked before ....Sorry.
> Running on E5500, Solaris 7.

And it's even frequently answered, yes.

Quote:> We have 15 Zombies processes by using the top command ....
> Is there a way to kill all these defunct processes without rebooting
> the server ???? The kill command doesn't work.

Kill cannot work on these "processes", because they are dead already.
Their parents are no longer waiting for them.

There's not much you can do about these. You can either kill the
parents, which will kill the zombies too (generally), or you can reboot,
which is rather drastic, but a safe bet.

Anyway, have a look at the comp.unix.questions FAQ, 3.13.
Also, have a look at the application(s) that caused to generate the
zombies. A zombie is almost always caused by buggy software.

Regards

Peter
--
You're entering the vicinity of an area adjacent to a location.
  - Futurama, A Head in the Polls

 
 
 

kill defunct processes

Post by Tony Walton - Sun Enterprise Services U » Tue, 17 Sep 2002 18:35:58



> Hi all,

> Perhaps, this question has been asked before ....Sorry.
> Running on E5500, Solaris 7.

> We have 15 Zombies processes by using the top command ....
> Is there a way to kill all these defunct processes without rebooting the
> server ???? The kill command doesn't work.

You can't kill a zombie as it's already dead. If you were running
Solaris 9 you could use preap, which persuades the parent of a zombie to
wait() for its child. Since you're not running Solaris 9, you'll need to
kill the zombies' parent - the zombies will then be inherited by init
(PID 1) - one of the things init does is wait() for zombies.

OTOH, why do you care?  

--
Tony Walton

The truth is out there.  The lies are inside your head.

 
 
 

kill defunct processes

Post by Peter Schmit » Tue, 17 Sep 2002 19:26:54



> > zombies. A zombie is almost always caused by buggy software.

> Your best bet is to apply a 2x4 to the side of the head of the
> developers who wrote the software.  Or hire better ones.

A 2x4 applied to the wrong(tm) side of the head might lead to erratic
hand movements resulting in far more terrible bugs than a simple zombie.

Better lart the users for starting the application in the first place.

Peter

--
Smoke Crack. Worship Satan. Admin Unix.

 
 
 

kill defunct processes

Post by SpiceBu » Tue, 17 Sep 2002 19:39:40



Quote:> We have 15 Zombies processes by using the top command ....
> Is there a way to kill all these defunct processes without rebooting the
> server ???? The kill command doesn't work.

when a sub-process dies, the parent may want to know the reason why.
The "problem" is that there is no maximum delay to fetch the reason.

To make this info always available, the system keeps a "copy" of
the sub-process (which is dead) : this is the defunct process.

Solution : you can kill the parent (then the system knows that the
info can be dropped), or you can make the parent always asking the
post-mortem info (if you want/can/know how to do that).

In the other case, this could be described as a bug.  :)

SpiceBug

 
 
 

kill defunct processes

Post by Tony Walton - Sun Enterprise Services U » Tue, 17 Sep 2002 19:52:52




> >   You can't kill a zombie as it's already dead. If you were running
> >   Solaris 9 you could use preap, which persuades the parent of a zombie to
> >   wait() for its child.

> Wow, Sun finally has something to deal with it!

> Can youz post the man page?

User Commands                                            preap(1)

NAME
     preap - force a defunct process to be reaped by its parent

SYNOPSIS
     preap [-F] pid...

DESCRIPTION
     A defunct (or zombie) process is one whose exit  status  has
     yet  to  be  reaped by its parent. The exit status is reaped
     via the wait(2), waitid(2), or waitpid(2)  system  call.  In
     the  normal  course  of system operation, zombies may occur,
     but are typically short-lived. This may happen if  a  parent
     exits  without  having reaped the exit status of some or all
     of its children. In that case, those children are reparented
     to  PID  1.  See  init(1M),  which  periodically  reaps such
     processes.

     An irresponsible parent process may not exit for a very long
     time and thus leave zombies on the system. Since the operat-
     ing system destroys  nearly  all  components  of  a  process
     before  it  becomes  defunct,  such defunct processes do not
     normally impact system operation. However, they do consume a
     small amount of system memory.

     preap forces the parent of the process specified by  pid  to
     waitid(2) for pid, if pid represents a defunct process.

     preap  will  attempt  to  prevent  the  administrator   from
     unwisely  reaping a child process which might soon be reaped
     by the parent, if:

        o  The process is a child of init(1M).

        o  The parent process is stopped and might  wait  on  the
           child when it is again allowed to run.

        o  The process has been defunct for less than one minute.

OPTIONS
     The following option is supported:

     -F    Forces the parent to reap the child, overriding safety
           checks.

OPERANDS
     The following operand is supported:

     pid   Process ID list.

EXIT STATUS
     The following exit  values  are  returned  by  preap,  which
     prints the exit status of each target process reaped:

     0     Successfully operation.

     non-zero
           Failure, such as no such process,  permission  denied,
           or invalid option.

--
Tony

 
 
 

kill defunct processes

Post by Drazen Kaca » Tue, 17 Sep 2002 20:42:45



Quote:>  You can't kill a zombie as it's already dead. If you were running
>  Solaris 9 you could use preap, which persuades the parent of a zombie to
>  wait() for its child. Since you're not running Solaris 9, you'll need to
>  kill the zombies' parent

You don't need to take such drastic action. You can attach to the parent
with a de* and then do whatever needs to be done.

--
 .-.   .-.    I don't work here. I'm a consultant.
(_  \ /  _)

     |

 
 
 

kill defunct processes

Post by Chris Co » Wed, 18 Sep 2002 00:35:32





>>>  You can't kill a zombie as it's already dead. If you were running
>>>  Solaris 9 you could use preap, which persuades the parent of a zombie to
>>>  wait() for its child.

>>Wow, Sun finally has something to deal with it!

>>Can youz post the man page?

> User Commands                                            preap(1)

> NAME
>      preap - force a defunct process to be reaped by its parent

Cute.  Soon Solaris will be as good as Windows :-)
This seems to be a super-bandage on top of bleeding software.
I always prefered a good kill -9 of the stupid parent, of course
killing init never worked quite right :-)
 
 
 

kill defunct processes

Post by Dan » Wed, 18 Sep 2002 06:10:38





<snip>

>      An irresponsible parent process ...

<snip>

I like that.  Can we put the CPU in jail?  Nothing like a politically
correct operating system.  Deadbeat NFS servers, you are next!

 
 
 

kill defunct processes

Post by G. Lo » Wed, 18 Sep 2002 16:50:14


hehehe! the day we could pkill -9 init...! =P~

BTW, "preap" binary works on Sol8...! >=) that's "backward"
compatibility!

Cheers!

Georgie

 
 
 

kill defunct processes

Post by Barry Margoli » Thu, 19 Sep 2002 02:01:13







><snip>

>>      An irresponsible parent process ...

><snip>

>I like that.  Can we put the CPU in jail?

No, but we can take the child away from the parent, and put it in init's
foster care.  But no one seems to be keeping an eye on him, because his
foster children tend to disappear. :)

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

kill defunct processes

Post by Barry Margoli » Thu, 19 Sep 2002 01:59:19




>hehehe! the day we could pkill -9 init...! =P~

>BTW, "preap" binary works on Sol8...! >=) that's "backward"
>compatibility!

My guess is that it works using the technique one of the other posters
suggested: it connects to the process like a de* and forces it to call
waitid().  So it's probably not too dependent on the Solaris version.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

kill defunct processes

Post by Gran » Fri, 20 Sep 2002 12:30:00


Quote:

> You can't kill a zombie as it's already dead. If you were running
> Solaris 9 you could use preap, which persuades the parent of a zombie to
> wait() for its child. Since you're not running Solaris 9, you'll need to
> kill the zombies' parent - the zombies will then be inherited by init
> (PID 1) - one of the things init does is wait() for zombies.

> OTOH, why do you care?  

Well one reason that zombie's can drive you nuts is that they can bust the
system so you must reboot. We used to have a couple processes that would
fork children out and use the serial ports. When the parent died, the
zombies would stick around. I can't remeber all the details, but the
zombies parent "became" the kernel... Then in that case, it really blew
goats. Though I think there was some funky way to attach to ther kernel and
wack them.

At one point the developers fixed the code, but it did get annoying when it
was in its early dev stages. Especailly since everyone got to share the one
stupid machine.

-grant

 
 
 

1. Killing Defunct processes

Could anyone tell me what are defunct processes, how are they created and
how to kill them?

Thanks in advance.

--
------------------------------------------------------------------------------

Systems Programmer         /_| \              
Education Data Centre     /  | //\             Phone   : (65) - 4714127
Ministry of Education    (___|//__             Fax     : (65) - 4737513
Kay Siang Road           =========
Singapore 1024          

2. Which is "better" Sun Sparc with Solaris or 486/586 with Unixware

3. How to kill defunct processes

4. rc.local substitution

5. killing defunct processes

6. Viewing a Sun W/S on a windows network

7. kill defunct processes

8. SLIRP , got it compiled, now how do I run?

9. defunct processes ; killing

10. kill <defunct> processes

11. killing "defunct"/unkillable process OSF1

12. defunct process kill SS5!

13. quick way of killing multiple <defunct> processes