> -----Original Message----- > From: Ken Lehman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 17, 2002 11:52 AM > To: '[EMAIL PROTECTED]' > Subject: catch kill -9 from unix command prompt > > > Is there a way for my program to execute a few lines of code > before dying > when it is sent a kill -9 from a unix shell? The book I have > says no, I > don't want to ignore the signal, just some clean up. > Thanks.
No. SIGKILL cannot be caught. If it could, you could prevent the sysadmin from terminating your process. SIGKILL is not designed for gracefully terminating. Use SIGTERM and/or SIGINT for that, both of which can be caught. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]