On Sat, Dec 18, 1999 at 12:02:27AM -0800, Bill Moseley wrote:
>
> I think the close() does the wait, so I don't really need to worry about
> reaping my children.
You are right here. close() does implicit wait on child to finish.
I don't really understand why are you getting SIGPIPE. That signal is
supposed to come only when you WRITE to the pipe and pipe dies. At
least in my tests I could get that signal from pipes that I read from.
>From all my experiments when I have a pipe that I read from then
close() doesn't actually finish the process. It only waits for it to
finish. If you really need to terminate your pipe before it naturally
finishes then you should kill it and then call close. The last will
return you $? non-zero because child terminated abnormally. But it
shouldn't send SIG{PIPE}. All of this I tested under regular perl.
Mod perl could be different because it's actually httpd running.
I took a rule for myself. If I have to execute external program from
my code then that code doesn't make it into mod_perl. Simply because
it's not worth it. All my savings are nothing comparing to the effort
of doing fork and starting external program. The chain is as weak as
the weakest ring.
Andrei
--