How to Commit Genocide on Annoying Processes

A few days ago I came across some processes on one of our servers that just wouldn’t die. Even after doing a kill -9 and all that good stuff, more would just keep spawing until there were dozens running on the machine. A head system admin of ours gave me this command, which will mass-kill all alike processes so they don’t have a chance to re-spawn each other.

The processes running were all some form of “init_”, like init_1, init_13, etc. To kill these:

ps aux |grep init_ |awk ‘{print $2}’ |awk ‘{print “kill -9 ” $1}’ | sh -v

The ‘grep init_’ should reflect the common name of all the processes.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *