Don't ask to ask, just ask | |
PerlMonks |
Re: Why this daemon can only receive the HUP signal no more than one time?by chb (Deacon) |
on Feb 23, 2009 at 10:58 UTC ( [id://745743]=note: print w/replies, xml ) | Need Help?? |
I haven't tested any code, but it always looks like a red flag to me if there is significantly more stuff than variable assignment inside a signal handler. In doSigHup() you are doing the whole relaunch inside a signal handler sub. I would try to call relaunch() from the main loop in hupMain(). doSigHup() would just set a global variable (e.g. $do_relaunch = 1) which must be checked in the main loop.
In Section
Seekers of Perl Wisdom
|
|