killall is your friend

I created a backup script that needed to run as root. For convenience, I named the script backupWeb.sudo and created a script called backupWeb that would call backupWeb.sudo with sudo. Of course, I forgot the .sudo suffix, and the script launched itself recursively. The result was a less-lethal fork bomb.

My computer was nearly unresponsive. Thankfully, there was just enough juice to run killall. killall saves the day! (Also handy in a pretty much identical way is pkill.)

Post a Comment

Your email is never shared. Required fields are marked *

*
*