Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is the best way to kill Zombie processes and D state process by single command.

share|improve this question

3 Answers 3

up vote 11 down vote accepted

Double tap.

Actually, reboot. There's no real way to easily get rid of a zombie, but there's really no reason to because a zombie isn't taking up resources on the computer; it's an orphaned entry in a process table. Init is supposed to collect it but something went wrong with the process. http://en.wikipedia.org/wiki/Zombie_process

Perhaps you're asking because there's worse problem...are you getting a boatload of zombies roaming your process table? That usually means a bug in the program or a problem with a configuration. You shouldn't have a huge number of zombies on the system. One or two I don't worry. If you have fifty of them from Apache or some other daemon, you probably have a problem. But that's not directly related to your question...

share|improve this answer
    
there are around 10 zombie process –  vnix27 Mar 23 '11 at 10:21
    
What are the processes? –  Bart Silverstrim Mar 23 '11 at 12:45
/sbin/reboot

You can't kill a zombie - its already dead

If the ppid still exists, then terminating that can often clean up the spawned zombies.

You shouldn't be killing processes in uninterruptible sleep - usually this means they're i/o bound, but IIRC it can also occur during a blocking read from e.g. a network socket.

share|improve this answer

Errors in underlying filesystem or disks might cause I/O bound processes. In this case try to "umount -f" the filesystem they depend upon - this will abort whatever outstanding I/O requests there are open.

share|improve this answer
    
And lose data. Doesn't sound like a great idea. –  Michael Hampton Apr 6 at 13:59
    
You lose data anyway by reboot. This way you might avoid reboot - useful feature on production or development systems. –  Arie Skliarouk Apr 7 at 15:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.