Re: Writing to log file when script is killed



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



Relevant Pages

  • Setting bp on the message map
    ... I'd want to intercept all messages going thru the map of my application ... ON_COMMAND(ID_FORMVIEW, OnFormView) ... meaning a bp on it. ...
    (microsoft.public.vc.language)
  • Re: glmfit function
    ... When I run the glmfit function I obtained a 31*1 vector. ... meaning of the values in each row. ... The intercept, and the 30 coefficients for your 30 columns of x. ...
    (comp.soft-sys.matlab)
  • Re: glmfit function
    ... When I run the glmfit function I obtained a 31*1 vector. ... meaning of the values in each row. ... The intercept, and the 30 coefficients for your 30 columns of x. ...
    (comp.soft-sys.matlab)
  • Re: Bush approval ratings on the mend
    ... > brickbat wrote: ... >>> intercept? ... I've been meaning to ask if you were ... Prev by Date: ...
    (alt.religion.islam)