Results 1 to 5 of 5

Thread: Linux Kill script

Threaded View

  1. #5
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    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.
    Last edited by nebulus200; November 24th, 2006 at 03:46 PM.
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •