Forking a process [in Practical mod_perl book]

Forking a process [in Practical mod_perl book]

am 17.04.2008 18:29:27 von Raymond Wan

Hi all,

I'm trying to fork a long-running process which I do not want to wait
for. I was getting a lot of "ssh " processes, so I did some
googling and found this from the aforementioned O'reilly book:

http://www.perl.com/lpt/a/701

And sure enough, there's a section on "Avoiding Zombie Processes". In
this section's example code, the authors have added these two lines to
the top:

-----
my $r = shift;
$r->send_http_header('text/plain');
-----

which did not exist in the previous examples. I don't quite understand
why setting the HTTP header has any relevance to zombie processes.
Apologies if I missed it somewhere on this page, but could anyone shed
some light on why these two lines are important enough to remain in all
future examples on this topic?

Thank you!

Ray

Re: Forking a process [in Practical mod_perl book]

am 17.04.2008 19:50:02 von Raymond Wan

Hi all,

Raymond Wan wrote:
> -----
> my $r = shift;
> $r->send_http_header('text/plain');
> -----


Sorry for the trouble but while googling for the problem, I came by the
reason: "send the output of system() to the client":
http://www.mail-archive.com/modperl@apache.org/msg36062.html

I also realized that the solution for modperl1 differs for modperl2 and
the above snippet seems relevant to MP1...

Thanks!

Ray