Created
June 12, 2009 13:48
-
-
Save jshirley/128642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: "MyApp" | |
server_class: "FCGI::Engine::Manager::Server::HTTP::Prefork" | |
scriptname: "script/myapp_prefork.pl" | |
nproc: 3 | |
pidfile: "run/myapp.pid" | |
socket: "" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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