Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Interrupt Handling

by zentara (Archbishop)
on Sep 02, 2012 at 10:16 UTC ( #991259=note: print w/ replies, xml ) Need Help??


in reply to Interrupt Handling

You havn't shown code, but it is likely you need a localized SIG handler in your children.

#!/usr/bin/perl $SIG{INT} = sub { print "Caught zap in $$\n"; exit }; if ( my $pid = fork() ) { print "Parent Start\n"; sleep 5; local $SIG{INT} = sub { print "Parent $$ ignoring zap\n" }; kill 2 => $pid, $$; sleep 10; print "Parent exit!\n"; } else { print "Child start\n"; sleep 10; print "Child exit!\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Interrupt Handling
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-07-29 01:56 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 (260 votes), past polls