Igor wrote:
[...]
Without the additional fork in "exit if fork() > 0;", background
scripts which are started from exec(...) are killed when request is
complete. Without the additional fork(), the PID for the bg process
will be the same as for the "exec_helper.pl" script (since "exec" is
used). Apache (apr?) knows this PID and it looks like it sends it a
SIGKILL signal at request cleanup phase. I was not able trap other
signals.

Actually we (mp2) have an almost complete control over it. The spawn_proc_prog was at some point modeled after mod_cgi. How about this patch:


Index: xs/Apache/SubProcess/Apache__SubProcess.h
===================================================================
--- xs/Apache/SubProcess/Apache__SubProcess.h   (revision 154417)
+++ xs/Apache/SubProcess/Apache__SubProcess.h   (working copy)
@@ -90,7 +90,7 @@
         return rc;
     }

-    apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
+    /*apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);*/

     if (!(*script_in = procnew->in)) {
         Perl_croak(aTHX_ "broken program-in stream");

Normally it's a goodness for processes that need to run while Apache is running. However in your case another fork is a waste, so if the above works, we should call it unless an argument was passed not to call it.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to