Re: Writing to log file when script is killed
- From: Heiko Wundram <modelnine@xxxxxxxx>
- Date: Sat, 30 Apr 2005 22:28:10 +0200
Am Samstag, 30. April 2005 14:26 schrieb wittempj@xxxxxxxxxxx:
> If you run on unix you can use the signal module to intercept a kill -
> see http://docs.python.org/lib/node368.html for a quick example
You cannot intercept a kill (that's the whole meaning of SIGKILL, rather than
SIGTERM)... Read up on UNIX signal handling.
But, for the rest: you could intercept SIGTERM, log a message, and raise a
SystemExit exception. That should do the trick.
--
--- Heiko.
see you at: http://www.stud.mh-hannover.de/~hwundram/wordpress/
Attachment:pgprMrQjXcbn4.pgp
Description: PGP signature
- References:
- Writing to log file when script is killed
- From: Harlin Seritt
- Re: Writing to log file when script is killed
- From: wittempj@xxxxxxxxxxx
- Writing to log file when script is killed
- Prev by Date: Re: array type casting problem in scipy.interpolate
- Next by Date: Re: [newbie] Embedding Flash OCX object
- Previous by thread: Re: Writing to log file when script is killed
- Next by thread: How to run a program?
- Index(es):
Relevant Pages
|