*rant*
Most of the time when I see someone asking how to kill a process on *nix I see someone responding "kill -9 <pid>".
Alas, this is NOT the way you kill a process … the process gets killed alright, and a little too hard. So for everyone not understanding, here’s a small explanation. Everyone who knows, just skip to the next post 😛
Normally when you (or something) kill a process, it gets a SIGTERM. When a program receives SIGTERM, it knows it should shut down and saves all its open files (or prompts the user), closes its file handles, etc etc. When you use -9, you send a SIGKILL which causes the OS to clean up the process without further ado (e.g. when it doesn’t respond to SIGTERM anymore), and shut it down. This also kills the process indeed, but doesn’t always have the intended effect when looking at data loss… Remember it 😉
*end of rant*
Incoming Links (via Technorati):
Nothing Reported