1 package Catalyst::Script::FastCGI;
3 use MooseX::Types::Moose qw/Str Bool Int/;
5 use namespace::autoclean;
7 sub _plack_engine_name { 'FCGI' }
9 with 'Catalyst::ScriptRole';
12 traits => [qw(Getopt)],
16 documentation => 'Specify a listening port/socket',
20 traits => [qw(Getopt)],
21 cmd_aliases => [qw/pid p/],
24 documentation => 'Specify a pidfile',
28 traits => [qw(Getopt)],
31 cmd_aliases => [qw/d detach/], # Eww, detach is here as we fucked it up.. Deliberately not documented
32 documentation => 'Daemonize (go into the background)',
36 traits => [qw(Getopt)],
40 documentation => 'Use a different FastCGI process manager class',
44 traits => [qw(Getopt)],
48 documentation => 'Log STDERR',
52 traits => [qw(Getopt)],
56 documentation => 'Specify a number of child processes',
59 sub _plack_loader_args {
62 map { $_->[0] => $self->${ \($_->[1] ? $_->[1]->[0] : $_->[0]) } }
63 Data::OptList::mkopt([
64 qw/pidfile listen manager nproc keep_stderr/,
65 detach => [ 'daemon'],
70 sub _application_args {
75 nproc => $self->nproc,
76 pidfile => $self->pidfile,
77 manager => $self->manager,
78 detach => $self->daemon,
79 keep_stderr => $self->keeperr,
84 __PACKAGE__->meta->make_immutable;
88 Catalyst::Script::FastCGI - The FastCGI Catalyst Script
92 myapp_fastcgi.pl [options]
95 -? --help display this help and exits
96 -l --listen Socket path to listen on
97 (defaults to standard input)
98 can be HOST:PORT, :PORT or a
100 -n --nproc specify number of processes to keep
101 to serve requests (defaults to 1,
103 -p --pidfile specify filename for pid file
105 -d --daemon daemonize (requires -listen)
106 -M --manager specify alternate process manager
107 (FCGI::ProcManager sub-class)
108 or empty string to disable
109 -e --keeperr send error messages to STDOUT, not
114 Run a Catalyst application as fastcgi.
118 Catalyst Contributors, see Catalyst.pm
122 This library is free software. You can redistribute it and/or modify it under
123 the same terms as Perl itself.