/home

Icon

Informations, tips and technics.

Kill me this Zombie Process !!!

Sooner or later, you will have to kill some zombie process. Check Wikipedia (http://en.wikipedia.org/wiki/Zombie_process) to know that are they and why they are your enemies…

 Anyway, some of you may have installed Nagios to monitor those zombie process and a small utility to kill them could be :

 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

 Note that you can also create a cron job to do that automatically.

Advertisements

Filed under: Bash, Linux,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: