0

Kill Usage

kill -HUP PID
kill -TERM PID
kill -KILL PID
(I did not write this, I just found it and posted it here for my own reference.)
Why does everyone jump straight to -9?

DO NOT USE -9 AS YOUR FIRST KILL SIGNAL.

Try a nice friendly -HUP … perhaps a little stronger -TERM.

If, for some reason, these don’t work, knock a little louder with -KILL (ie: -9), but don’t whine if something else gets hosed due to the strong signal (not to scare anyone, it’s unlikely that anything critical is happening anyway, any more than just writing a file– but you could leave resources locked/in use (ie: memory, etc)).

Also, use -HUP and -TERM and -KILL …. you’ll be thankful when you miss your kill -1 and do a kill 1 instead … you’ll use -HUP from then on (well, maybe not on a pda, but on a production server etc.)

UNIX kill signals

Signal

Name

Signal

Number

Action
HUP1Hangup
INT2Interrupt
QUIT3Quit (dumps core file)
ILL4Illegal instruction (dumps core file)
TRAP5Breakpoint trap (dumps core file)
IOT6I/O trap (dumps core file)
EMT7Emulator trap (dumps core file)
FPE8Floating Point Exception (dumps core file)
KILL9Kill with extreme prejudice
BUS10Bus error (dumps core file)
SEGV11Segment Violation (dumps core file)
SYS12Bad system call argument (dumps core file)
PIPE13Write to nonexistent pipe
ALRM14Alarm clock timeout
TERM15Terminate
USR116User defined signal
USR217User defined signal
CHLD18Child status (aka CLD)
PWR19Power failure or restart
WINCH20Window size change
URG21Urgent socket condition
IO22Socket I/O (aka POLL)
STOP23Stop from non-tty process (see CONT)
TSTP24Stop from tty process (see CONT)
CONT25Continue a stopped process
TTIN26Waiting for background tty input (see CONT)
TTOU27Waiting for background tty output (see CONT)
VTALRM28Virtual alarm timeout
PROF29Profiling timeout
XCPU30CPU time limit exceeded (dumps core file)
XFSZ31File size limit exceeded (dumps core file)

jlim0930

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.