Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When shou;ld I use kill -9

Shell

When shou;ld I use kill -9

by  pcunix  Posted    (Edited  )
From http://pcunix.com/SCOFAQ/scotec6.html#killminus9 :

When you can't kill it with -15.

The idea here is that properly written programs will respond to a -15 by cleaning up anything they need to do before dying. Understand that this is not a matter of priorities, or the
system giving more time with a -15; it's simply that a program can catch the -15, do what it needs to do and then voluntarily exit. It could also choose to ignore the -15 all together. If it
hasn't made any proviosions at all, the -15 works exactly like the -9: the process dies immediately.

A "kill -9" just causes the process to die; it gets no chance to do any cleanup. Therefore, if you don't know how a program was written, you should try the -15 first, in case it does need
to clean up files, flush logs or whatever. If the -15 doesn't work, then use the -9.

See also Why can't I kill a process with -9?
http://pcunix.com/SCOFAQ/scotec6.html#cantkill
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top