X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FFastCGI.pm;h=02ff9bd98e41d766381036535015d6daeb34e9cd;hp=47f1e1b1c6a770c1742a24465288a8087451562a;hb=9c74923de2304b8c8f0a7a2faa0854ad9b4d3a92;hpb=fb34eb9c063c53abd061d260a30f0ca7c57a0833 diff --git a/lib/Catalyst/Script/FastCGI.pm b/lib/Catalyst/Script/FastCGI.pm index 47f1e1b..02ff9bd 100644 --- a/lib/Catalyst/Script/FastCGI.pm +++ b/lib/Catalyst/Script/FastCGI.pm @@ -56,13 +56,34 @@ has nproc => ( documentation => 'Specify a number of child processes', ); +has title => ( + traits => [qw(Getopt)], + cmd_aliases => 't', + isa => Str, + is => 'ro', + lazy => 1, + builder => '_build_proc_title', + documentation => 'Set the process title', +); + +sub _build_proc_title { + my ($self) = @_; + return sprintf 'perl-fcgi-pm [%s]', $self->application_name; +} + +sub BUILD { + my ($self) = @_; + $self->title; +} + sub _plack_loader_args { my ($self) = shift; return ( map { $_->[0] => $self->${ \($_->[1] ? $_->[1]->[0] : $_->[0]) } } Data::OptList::mkopt([ qw/pidfile listen manager nproc keep_stderr/, - detach => [ 'daemon'], + detach => [ 'daemon' ], + proc_title => [ 'title' ], ]) ); } @@ -72,11 +93,12 @@ sub _application_args { return ( $self->listen, { - nproc => $self->nproc, - pidfile => $self->pidfile, - manager => $self->manager, - detach => $self->daemon, + nproc => $self->nproc, + pidfile => $self->pidfile, + manager => $self->manager, + detach => $self->daemon, keep_stderr => $self->keeperr, + title => $self->title, } ); } @@ -108,6 +130,7 @@ Catalyst::Script::FastCGI - The FastCGI Catalyst Script or empty string to disable -e --keeperr send error messages to STDOUT, not to the webserver + -t --title set the process title =head1 DESCRIPTION