Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: handling HUP signals

by almut (Canon)
on May 22, 2008 at 23:37 UTC ( [id://688063]=note: print w/replies, xml ) Need Help??


in reply to Re^2: handling HUP signals
in thread handling HUP signals

I haven't investigated this in every detail, but it looks to me like you're never exiting your catchHup() signal handler, once it got called. At the end of the handler you call start() which then calls $MANAGER->monitor();. At the end of that routine you have

HANGOUT: while (! $usr2) { sleep 1; } ... goto HANGOUT;

which looks like an endless loop to me...  i.e. you never leave that function, and thus you never leave the signal handler you called it from. And, as you probably know, signal handlers will not be reactivated before you have left them...

Update: Generally, it's a good idea to not do too much within a signal handler routine. In most cases it's best to just set some flag to which you can react in the main program's loop.

Replies are listed 'Best First'.
Re^4: handling HUP signals
by druidmatrix (Acolyte) on May 23, 2008 at 01:10 UTC
    Almut, you are absolutely correct. The problem was not exiting the signal handler. The solution was simply to have a global variable that is set in the catchHup handler and take the appropriate steps once that variable is set. Thanks!!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-16 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found