zombie process

Download zombie process

If you can't read please download the document

Upload: ashok-chakravarthy

Post on 29-Jun-2015

30 views

Category:

Documents


0 download

TRANSCRIPT

Zombie process is an inactive computer process, according to wikipedia article, "...On Unixoperating 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.

So how do I find out zombie process?Use top or ps command: # top OR # ps aux | awk '{ print $8 " " $2 }' | grep -w Z Output:Z 4104 Z 5320 Z 2945

How do I kill zombie process?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 (see below for more info).

How do I automate zombie process killing?Write a script and schedule as a cron job. 3. Crontab file Crontab syntax : A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.* * * * * command to be executed | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59)

A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM. 30 18 * * * rm /home/someuser/tmp/* 0 0 1, 10, 15 * * midnight on 1st ,10th & 15th of month export EDITOR=vi ;to specify a editor to open crontab file. crontab -e Edit your crontab file, or create one if it doesnt already exist. crontab -l Display your crontab file. crontab -r Remove your crontab file. crontab -v Display the last time you edited your crontab file.