Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 chilling in the Monastery: (13)
As of 2015-07-30 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls