OS Linux RH 7.3, ES2.1, ES3.0
question involves repeated use of signals. I've genned up signal support for INT and HUP as follows:
#
# interrupt support
#
use POSIX;
$sigset = POSIX::SigSet->new();
$actINT = POSIX::SigAction->new( 'SigInterrupt', $sigset, &POSIX::SA_N
+ODEFER );
$actHUP = POSIX::SigAction->new( 'SigHangup', $sigset, &POSIX::SA_N
+ODEFER );
POSIX::sigaction( &POSIX::SIGINT, $actINT );
POSIX::sigaction( &POSIX::SIGHUP, $actHUP );
$SIGINT = 0;
$SIGHUP = 0;
The variables $SIG* are just tweaked in the signal handlers. That's all that goes on in the handlers. I look for the tweaked value when I emerge from a select() loop and act accordingly.
This all works fine for the first signal processed. SIGINT causes a delayed exit, as desired. SIGHUP causes state info to go to log, as desired. However, repeating SIGHUP after the first SIGHUP doesn't do diddly. Bigger however, repeating SIGHUP *again* does cause the signal to be noticed. And so it goes, with every other SIGHUP signal apparently being noticed. WTH? Signals are sent to the process at a leisurely interval, on the order of seconds, so I am not believing that there are any signal stacking issues going on here. :-)
Can anybody explain this?
Thanks!
rnd
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.