Here Show archive.org snapshot is a good explanation for zombie processes.
Quote:
If you have zombie processes it means those zombies have not been waited for by their parent (look at PPID displayed by ps -l).
You have three choices: Fix the parent process (make it wait); kill the parent; or live with it.
Remember that living with it is not so hard because zombies take up little more than one extra line in the output of ps.
On a server I want to get informed if there are zombie processes and track them with a Icinga check. That's the reason why I want to get rid of them.
Example to get rid of the zombies (in this example there are some python zombie processes):
-
Get PPID of zombie process:
$ ps -ef | grep "python" [...] nova 13930 1543 0 Jun19 ? 00:00:00 [python] <defunct> nova 13931 1543 0 Jun19 ? 00:00:00 [python] <defunct> nova 13932 1543 0 Jun19 ? 00:00:00 [python] <defunct> nova 13933 1543 0 Jun19 ? 00:00:00 [python] <defunct> nova 13934 1543 0 Jun19 ? 00:00:00 [python] <defunct> nova 13935 1543 0 Jun19 ? 00:00:00 [python] <defunct> # PPID of all the zombie processes is 1543
-
Find the Parent process:
$ ps -ef | grep 1543 [...] nova 1543 1 0 2012 ? 00:19:37 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/
Now you have the two choices, fix it or kill it. In this case it's no critical service and I can just restart it.
Posted by Kim Klotz to makandra dev (2013-06-21 11:24)