Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Signal to parent-process. Does it affect it's children?

by betterworld (Curate)
on Sep 07, 2008 at 17:34 UTC ( [id://709661]=note: print w/replies, xml ) Need Help??


in reply to Signal to parent-process. Does it affect it's children?

I think the problem is that waitpid does not continue after the signal has been processed, however the child process is still running. I suggest putting a loop around waitpid. The return value of waitpid should give you a hint if the child actually exited or if a signal has interrupted the call.

Update: By the way, I don't think that you need to set the signal handler again in status. Once it has been set, it gets executed every time a USR1 signal arrives.

Replies are listed 'Best First'.
Re^2: Signal to parent-process. Does it affect it's children?
by rapide (Beadle) on Sep 07, 2008 at 18:42 UTC
    Seems like the interruption terminated the child. So far I haven't seen anything in the Poddoc manual.

    Resetting the signal handler depends on the system and whether its safe system calls or not. I'd rather be safe if I'm porting it to another system ..

      If you're ever thinking of porting to a Windows system, you should expect everything involving forking and external signals to break. That's because on the platform Perl emulates forking with multithreading, and that emulation may not work well with whatever emulation you find of Unix signals.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-19 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found