good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Handle SIGHUP with AnyEventby nutris (Initiate) |
on Aug 23, 2011 at 09:32 UTC ( [id://921850]=perlquestion: print w/replies, xml ) | Need Help?? |
nutris has asked for the wisdom of the Perl Monks concerning the following question: Hello, I am trying to use AnyEvent to handle signals (SIGHUP, SIGTERM, etc.). I think a I have to use AnyEvent since I need the process to listen to signals and filesystem events (via AnyEvent::Filesys::Notify). According to the documentation at http://search.cpan.org/~mlehmann/AnyEvent-5.34/lib/AnyEvent.pm#SIGNAL_WATCHERS I am trying the following:
Running this code on Debian Squeeze (Perl 5.10) and sending a SIGHUP to the process via kill -HUP 12345 perl just quits with the message "Hangup" spooled to STDIN. What am I doing wrong? I would expect to see my message "Got SIGHUP, reloading..." before the exit. But the message "Hangup" makes me feel like the signal was not handled by AnyEvent but directly by perl. Any suggestions? Thanks. nutris
Back to
Seekers of Perl Wisdom
|
|