LinuxHelps.com

A blog for Linux Lovers.

18
Jun 2009
Zombie process
Posted in Linux Helps by sibu at 7:28 pm |

Zombie process is an inactive computer process, according to wikipedia article, “…On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term’s colorful metaphor, the child process has died but has not yet been reaped…”

Use top or ps command to find out zombie process.

# top
OR
# ps aux | awk ‘{ print $8 ” ” $2 }’ | grep -w Z

Output:

Z 4104
Z 5320
Z 2945

You cannot kill zombies, as they are already dead. But if you have too many zombies then kill parent process or restart service.

You can kill zombie process using PID obtained from any one of the above command. For example kill zombie proces having PID 4104.

# kill -9 4104

Please note that kill -9 does not guarantee to kill a zombie process.Write a script and schedule as a cron job.The following is a script to kill Zombie processes.

Code:

for each in `ps -ef | grep ” | grep -v PID | awk ‘{ print $3 }’`; do
for every in `ps -ef | grep $each | grep -v cron | awk ‘{ print $2 }’`; do
kill -9 $every;
done;
done


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response:

LLOYD said:


PillSpot.org. Canadian Health&Care.Best quality drugs.Special Internet Prices.No prescription online pharmacy. Online Pharmacy. Buy pills online

Buy:Viagra Super Force.Cialis Soft Tabs.Propecia.Viagra Soft Tabs.Zithromax.Viagra Super Active+.Levitra.Viagra.Cialis Super Active+.Cialis Professional.Soma.Viagra Professional.VPXL.Cialis.Tramadol.Maxaman.Super Active ED Pack….


Leave a Reply