Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: print on reboot or process shutdown

by psini (Deacon)
on Jul 29, 2008 at 21:30 UTC ( #700927=note: print w/ replies, xml ) Need Help??


in reply to Re^2: print on reboot or process shutdown
in thread print on reboot or process shutdown

You can use a signal handler to cacth SIGTERM

$SIG{TERM}=sub { #do something here };

But that cannot trap a SIGKILL so if you or your system make a kill -9, it will not be intercepted. And, no, AFAIK there is no way to intercept a SIGKILL because it should be the last resort to kill a not responding process.

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."


Comment on Re^3: print on reboot or process shutdown
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://700927]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-12-26 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls