Skip to content

Instantly share code, notes, and snippets.

@jshirley
Created June 12, 2009 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshirley/128642 to your computer and use it in GitHub Desktop.
Save jshirley/128642 to your computer and use it in GitHub Desktop.
- name: "MyApp"
server_class: "FCGI::Engine::Manager::Server::HTTP::Prefork"
scriptname: "script/myapp_prefork.pl"
nproc: 3
pidfile: "run/myapp.pid"
socket: ""
#!/usr/bin/env perl
use strict;
use warnings;
use local::lib;
use FindBin;
use FCGI::Engine::Manager;
use lib "$FindBin::Bin/../lib";
my $cmd = shift @ARGV;
die 'Must supply command!' unless $cmd;
my $conf = "$FindBin::Bin/../conf/app_manager.yml";
print FCGI::Engine::Manager->new( conf => $conf )->$cmd;
package FCGI::Engine::Manager::Server::HTTP::Prefork;
use Moose;
our $VERSION = '0.01';
our $AUTHORITY = 'cpan:JSHIRLEY';
extends 'FCGI::Engine::Manager::Server';
# We don't actually hav ea socket
has 'socket' => (
is => 'rw',
isa => 'Str',
required => 0
);
sub construct_command_line {
my $self = shift;
return (
"perl",
($self->has_additional_args
? $self->additional_args
: ()),
$self->scriptname,
"--pidfile",
$self->pidfile,
"--background"
);
}
sub remove_pid_object { }
1;
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment