On Thu, 14 Dec 2000, Kees Vonk 7249 24549 wrote:

> On our intranet server I have a page that allows the user to 
> start a long running process. In order not to hang a httpd 
> child I fork off the process and detach it from the calling 
> process. This works fine most of the time.
> 
> However in the unusual situation where apache needs to be 
> restarted while the long running process is still running I 
> can not restart apache. It complains that: 'Address already 
> in use: make_sock: could not bind to address', which as far 
> as I can make out is because the long running process has 
> inherited the open sockets from the apache child.
> 
> Has anyone got an idea how to get around this? Can I get to 
> the inherited socket connection and close it when I have 
> detached from the calling process?

How about 

close STDOUT;
close STDIN;
close STDERR;

in your child code?

check this out:

http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subprocess

it's explained there.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  


Reply via email to