Re: IPC::Open3 and MP
Clinton Gormley <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2010-01-19 at 14:11 -0800, Randy J. Ray wrote:
> I have some code that uses IPC::Open3, and I've discovered (the hard
> way) that it doesn't work under MP2 and Apache 2.2.6. What is the
> "best practices" way of doing this under MP2?
I use IPC::Run, which works in mod_perl and non-mod_perl environments.
clint
>
> eval {
> local $SIG{ALRM} = sub { die "alarm\n" };
> alarm 30; # 30 seconds is more than enough for bogofilter to
> run
> $child = open3($ichld, $ochld, undef, @cmd);
> print $ichld $param->{'message'}, "\n";
> close($ichld);
> @response = <$ochld>;
> waitpid $child, 0;
> alarm 0;
> };
>
> I would prefer a solution that doesn't require adding a new CPAN
> module to our dependencies list, but if that's the only way, then I'll
> do it. This has to run in both MP2 and non-MP environments, so
> Apache::SubProcess probably isn't going to help me...
>
> Thanks in advance for any suggestions!
>
> Randy
> --
> Randy J. Ray / [email protected]
> Silicon Valley Scale Modelers: http://www.svsm.org
> Sunnyvale, CA