Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Daemon crashes the system

by RMGir (Prior)
on Nov 02, 2011 at 12:30 UTC ( #935375=note: print w/replies, xml ) Need Help??


in reply to Re: Daemon crashes the system
in thread Daemon crashes the system

Don't apologize - your English is far superior to my Polish (thank you, Google Translate, for helping me identify that as Polish :) )

I think all you need to do is add the following lines just below your last "use" statement:

use Config; # copied from perldoc Config my %sig_num; my @sig_name; unless($Config{sig_name} && $Config{sig_num}) { die "No sigs?"; } else { my @names = split ' ', $Config{sig_name}; @sig_num{@names} = split ' ', $Config{sig_num}; foreach (@names) { $sig_name[$sig_num{$_}] ||= $_; } } # ignore child signals, automatically reaping child processes $SIG{$sig_num{CHLD}} = 'IGNORE';
Of course, you'll have to test this, but I think it might solve your issue.

Mike

Replies are listed 'Best First'.
Re^3: Daemon crashes the system
by jjimmy (Initiate) on Nov 02, 2011 at 12:59 UTC
    RMGir, your way isn't working.
      jjimmy, how is it failing?

      Is there an error in my code, or is your program still failing to fork in the same way it was before?

      If it's still failing to fork, it's possible that there are too many php processes still running at one time...

      Do you know how how many php processes are started before fork fails? Do all of those php processes finish running, or are some of them or all of them still running when the daemon program dies?


      Mike
        maybe not enough, only 3. if I add: $ SIG {CHLD} = 'IGNORE'; in each sub?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935375]
help
Chatterbox?
LanX LOL of the day ... the Turkish Anonymous Alcoholics stopped their "No to alcohol" campaign for political reasons ...
LanX omg my browser is posting again on its own ...
[LanX]: choroba: GREAT JOKE! xD
LanX starts googling the punch line ...
[choroba]: suddenly, a weird noise can be heard, and the conductor stops them
[choroba]: (sorry, was interrupted by a call)
[choroba]: What was that? asks he
[choroba]: and the triangle player says, "That was me. It's written here in the score"

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-03-27 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (319 votes). Check out past polls.