> Hi Israel, Hi Michael,
> > I haven't used this but it looks like $r->cleanup_for_exec is used, in > the child once forked, to close the socket connecting Apache and the > client, failing which the child will hold on to the socket as long as > it runs, which will prevent Apache from reclaiming the same address on > restart (as explained in "Freeing the Parent Process" on the page you're > referring to). > > Looks like cleanup_for_exec was part of a mod_perl 1.0 third-party > module, isn't needed in mod_perl 2.0 any more and is only provided > as a NOOP in Apache2::compat. > > http://perl.apache.org/docs/2.0/user/porting/compat.html#C____r_E_gt_cleanup_for_exec___ > > \,,,/ > (o o) > ------oOOo-(_)-oOOo------ > $r->cleanup_for_exec wasn't a part of the mp1 core API, but > lived in a 3rd party module Apache2::SubProcess [this should > read Apache::SubProcess - M.L.]. That module's functionality > is now a part of mod_perl 2.0 API. But Apache 2.0 doesn't > need this function any longer. > ------------------------- > This is the 1.0 third-party module defining cleanup_for_exec: > > http://cpansearch.perl.org/src/DOUGM/Apache-SubProcess-0.03/SubProcess.xs > > The other function you're wondering about, spawn_proc_prog in mod_perl > 2.0 (Apache2::SubProcess), seems to be for running external programs > from mod_perl 2.0. The 1.0 equivalents, I think, are described in the > sections "Starting a Long Running External Program" and "Starting a > Short Running External Program" on the page you're referring to. > Thanks for the clarification. Finally I decided to use: $r->push_handlers( PerlCleanupHandler => sub { $obj->method } ); where $obj->method() executes the (short) external programs after the request have been served. -- Israel Leiva