"Cameron B. Prince" wrote:
> 
> Hi all,
> 
> I have an Embperl page that uses a custom module which has code that calls
> an external perl script via fork. This script takes a considerable amount of
> time to run and I need it to just run in the background. I've gotten it to
> work but I'm noticing that I've got zombies once the processes complete
> until I restart Apache.
> 
> Here's the code:
> 
>    my $pid;
> 
>    unless ($pid = fork) {
>       local($SIG{HUP}) = 'IGNORE';
>       local($SIG{USR1}) = 'IGNORE';
>       local($SIG{USR2}) = 'IGNORE';
>       exec $command;
>       die "no exec";
>       exit 0;
>    }
> 
> Am I missing a signal or something to run this command as an entirely
> stand-alone process?

This document talks about the correct way to fork from mod_perl:

http://perl.apache.org/docs/1.0/guide/performance.html#Forking_and_Executing_Subprocesses_from_mod_perl

Hope this helps...

/Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • Forking Cameron B. Prince
    • Neil Gunton

Reply via email to