Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: fork/reaper

by blue_cowdawg (Monsignor)
on Mar 29, 2004 at 15:26 UTC ( #340635=note: print w/replies, xml ) Need Help??


in reply to fork/reaper

      I'm not sure to understand how waitpid works, as my script always dies returning "No children at test.pl lineXX".

IIRC by the time your handler is called your child has already died.


Peter L. Berghold -- Unix Professional
Peter at Berghold dot Net
   Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.

Replies are listed 'Best First'.
Re: Re: fork/reaper
by fxmakers (Friar) on Mar 29, 2004 at 15:39 UTC
    Any idea on how to get children's exit $result before he dies?

    UPDATED: ok I think I got it
    Added &reaper into the infinite loop and deleted $SIG{CHLD}
    Seems to work now.
    (I'd like to know if this is the good way)

          Any idea on how to get children's exit $result before he dies?

      You probably should keep a SIGCHLD handler around just to catch that signal to avoid zombies.


      Peter L. Berghold -- Unix Professional
      Peter at Berghold dot Net
         Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2023-02-02 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (24 votes). Check out past polls.

    Notices?