[Catalyst] Running system commands under FastCGI with IPC::Cmd / IPC::Run

Tomas Doran bobtfish at bobtfish.net
Thu Oct 28 09:12:15 GMT 2010


On 26 Oct 2010, at 18:15, Larry Leszczynski wrote:
> If you can't upgrade (or upgrading doesn't fix things),

Upgrading will fix that error, that's what I patched FCGI for ;)

> you can also do
> something like this before the IPC call:

Or more elegantly, in the script:

package MyApp::Script::FastCGI;
use Moose;
use FCGI;
use namespace::autoclean;

extends 'Catalyst::Script::FastCGI';


>
>    # HACK HACK HACK
>    # Fix for running IPC::Run under FastCGI
>    # See: http://www.mail-archive.com/ports@openbsd.org/msg16948.html
>    #
>    unless (exists &FCGI::Stream::FILENO)
>    {
>        *FCGI::Stream::FILENO = sub { return -2 };
>    }


1;

Cheers
t0m




More information about the Catalyst mailing list