Would recommend you use -15 instead of -9 first. -15 is a normal close process signal. Some processes are particularly ticky about having everything dropped out beneath them (which is what 9 does...think of it as 'die, die now, don't do anything else but die'). Kill -9 is great when a process is truly hung, but if you are just wanting to stop a running process that isn't hung, 15 is much safer.
EDIT: Side note, many variations of unix also have a pkill command, which will let you kill by the process name, rather than the PID, which could also be helpful for scripting a shutdown process.
EDIT 2: 'kill' is also a misnomer. Kill is really a signaling program that can be used to send out of program signals to a running process. Somewhere in your unix source includes should be a signal.h if you want to look at all the different signals you can send. AFAIK, you'll need to send what signal you want to send to the process when you issue the command (so kill `cat /somedir/someprocess.pid` should also have the -15 or -9 (or whichever) in there as well.




Reply With Quote