perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Gao <J....@isu.usyd.edu.au>
Subject Re: mod_perl, pipes, and "No child processes"
Date Tue, 06 Nov 2001 23:20:08 GMT
On Tue, 6 Nov 2001, Tom Servo wrote:

> Hello all.   I'm writing an app that opens a pipe to sendmail, which if
> memory serves, forks off a child process of apache to do the pipe, then
> exits as soon as it's finished.
>
> I was doing this with MIME::Lite, and it's been working absolutely
> splendidly on Linux and on Solaris 7.   However, on Solaris 8 (and I don't
> know if this is related to the OS or not) it gives me all sorts of
> problems.   Namely, this started after checking the return code on a
> MIME::Lite object called $msg after calling the send method.   It usually
> returns a 1 on success, but on the new box it was returning 0, despite the
> fact that the e-mails were actually going out.
>
> I ended up writing a test on that just opens a filehandle to |
> /usr/lib/sendmail -t -ei -eom, then printing to the filehandle, and
> closing the filehandle.   If memory serves, it's almost impossible to get
> something accurate out of this statement in mod_perl:
>
> open(SENDMAIL, "| /usr/lib/sendmail -t -ei -eom") or do_something();
> As that just reports on whether or not an apache child process was able to
> spawn, not whether it was actually able to open the pipe to sendmail.
>
> So, that runs fine, then the print works as I actually get the e-mails
> it's trying to send, but this bit of code:
>
> close(SENDMAIL) or print STDERR "Filehandle close failed: $!";
>
> spits out: "Filehandle close failed: No child processes"
>
> Any ideas what is causing this?   Like I said, the mail goes out fine, but
> it makes it pretty difficult to check the return code since it's always
> coming back false.

Shouldn't you check $? instead?



Jie


Mime
View raw message