Tuesday, May 29, 2007

Killing all zombie processes

its this one liner:
kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`


explanation:
list all processes, show me the good stuff, like stat[e] p[arent]pid, pid, and c[om]m[an]d
Then, send the output to grep, because I only want the lines that start with a Z or z . Now let's restart the parent processes and shake out the zombie generation.

Found here