[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



use POSIX;

sub SIGHUP {
  # do Something
}
  my $sigset = POSIX::SigSet->new();
  my $action = POSIX::SigAction->new('SIGHUP', $sigset,
&POSIX::SA_NODEFER);
  POSIX::sigaction(&POSIX::SIGHUP, $action);



On Thu, 2005-05-26 at 15:00, Christopher Fowler wrote:
> The child that gets executed after a SIGHUP ignores SIGHUP.  What is the
> best way to fix in Perl?
> 
>   $SIG{'HUP'} = sub {
>     _print "Recevied SIGHUP! Restarting.\n";
> 
>     # Kill all the children
>     my @goners = ();
>     foreach my $ref (keys %GordonKapes) {
>       push @goners, $GordonKapes{$ref}{'PID'};
>     }
> 
>     $TERMINATION = 1;
>     kill 9, @goners;
> 
>     my $pid = fork();
>     exit 0 if $pid;
> 
>     # Allow things to settle down;
>     sleep(1);
> 
>     exec ("/opt/SAM/gk/gkd.pl") or die "$!\n";
> 
>   };
> 
> Thanks, 
> Chris
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00954" href="msg00954.html">[ale] $SIG{'HUP'}</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00959.html">[ale] IPv6 for the Linksys WRT54G</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00961.html">[ale] IPv6 for the Linksys WRT54G</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00954.html">[ale] $SIG{'HUP'}</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00955.html">[ale] javascript  Virus</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00960"><strong>Date</strong></a></li>
<li><a href="threads.html#00960"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>