Ah cool - many thanks to all.
I can confirm that updating FCGI to 0.71 fixes the issue when using IPC::Run
explicitly. The following now works as expected under FCGI:
my ($in, $out, $err);
my $success = IPC::Run::run \...@cmd_args, \$in, \$out, \$err,
IPC::Run::timeout( 10 );
Just out of interest - the following still doesn't work:
my ($success, $error_code, $full_buf, $out_buf, $err_buf) =
IPC::Cmd::run(
command => \...@cmd_args,
verbose => 0,
timeout => 10,
);
It goes past the timeout and the log has the error:
"Could not dup 'STDIN': Invalid argument"
I haven't looked under the hood but this doesn't seem to be anything to do
with Catalyst so I'll take it away from this mailing list - I'll investigate
further and log it with IPC::Cmd if necessary.
Thanks again,
Ian
On 22 October 2010 05:34, Toby Corkindale <[email protected]> wrote:
> On 22 October 2010 05:43, Ian Sillitoe <[email protected]> wrote:
> > I have a Catalyst model that runs a system command as part of a search
> > facility. The system call only takes a fraction of a second so is
> processed
> > inline and this all works fine when tested outside of Catalyst and when
> > called under the Catalyst standalone server. However, when I deploy it to
> my
> > FastCGI environment I have problems - everything seems to work fine apart
> > from the results of the system call.
> >
> > The system call is (give or take):
> >
> > IPC::Cmd::run(
> > command => [qw/ blastall -d sequences.db -i input.fa -o
> > output.results /],
> > verbose => 0,
> > timeout => 10,
> > );
>
> I recall that IPC::Run certainly has known-issues when used under
> FastCGI, and I'm guessing they extend to IPC::Cmd too.
>
> Have a look at IPC::Run::SafeHandles which I think got around it.
>
> Toby
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
--
Ian Sillitoe
CATH Team -- http://www.cathdb.info
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/