LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   A Sure Shot Way To Kil Zombie Processes (https://www.linuxquestions.org/questions/linux-desktop-74/a-sure-shot-way-to-kil-zombie-processes-553777/)

ehsanj 05-14-2007 11:09 AM

A Sure Shot Way To Kil Zombie Processes
 
Recently I have noticed that each time I boot up my CentOS 5 box, two processes in the Gnome System Monitor are listed as Zombie. These are netstat and Xsession. No matter how I try to kill them (by trying to stop, kill, or end them), they stay in the list.

Is there a shore shot way to get rid of these two always-zombie processes?

GrapefruiTgirl 05-14-2007 11:23 AM

http://www.cyberciti.biz/tips/killin...e-process.html

Short answer :p is you cannot kill zombies, they are already dead!!
The above link will start you in the right direction however. I found it by Googling 'linux zombie processes'.

ehsanj 05-14-2007 12:30 PM

I've read the article you suggested. Things are somewhat obscure and need some research on my part. The article suggests that it's okay to live with Zombies as they don't take up much of the system resources. However, I feel kinda uncomfortable living with 'em ;) .

Hopefully, I'll be posting back a solution soon.

ehsanj 05-15-2007 12:48 AM

An article on Zombie Processes at LinuxSA summarizes very well what's described at Wikipedia.

There are actually four ways to deal with Zombie processes:
  • Fix the parent; make it wait() for the Zombie process. this can be done simply by issuing this command:
    Code:

    kill -s SIGCHLD PPID
    However, buggy software will simply ignore this command. In most cases, the software being buggy is the very reason for a Zombie process.
  • Kill the parent; be cautious with this option and know the repercussions of killing a running process dead.
  • Make the Zombie process a grand child of another process and then kill that process immediately; this will make the Zombie a child of init (PID 1) which regularly puts Zombies to eternal rest; I don't know of an easy way of doing this. You'll need to write code to make this happen.
  • Live with the Zombie process; this should not be an issue (try not to think about them :) ) as they don't have any resources tied up to them but if there are a lot of Zombies, under a heavy load you might potentially run out of PIDs

I hope this post is informational. But again the main issue remains the same, we still have no sure-shot way of getting rid of Zombies. May be if I can collect some more interesting information on this, I'll be posting it back here.

ehsanj 05-15-2007 12:50 AM

Ah sorry. I forgot to say you thanks, GrapefruiTgirl. Thank you very much for getting me started in the right direction.


All times are GMT -5. The time now is 12:17 PM.