Jason Horman wrote:
>
> I am forking b/c PursuitSpider takes about 2 hrs to run. The above works
> ok but I end up with a defunct libhttpd.ep process left around. I tried
> to setpgrp(0, $$) and POSIX::setsid() from within the child code but
> neither seem to detach correctly. Is there something else I need to do?
>
In general, people find that forking & mod_perl are not
a good mix. If you are going to get it to work, you need
to set
$SIG{CHLD} = 'IGNORE';
before the fork, so you don't leave your child processes zombied.
Another way of doing this, should you run into other fork
problems, is insert a run record into a database that gets
picked up by a cron job later, and forks off a PursuitSpider
when relevant.
-- Joshua
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks >> free web link monitoring Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051