PET::RUN::FCGIProcManager

This package to run PET in FCGI mode, using FCGI::ProcManager.

This runs pet as a preforked external daemon, and listen to a socket on which it expects FastCGI communication.  If a child dies, a new process is forked.  Sending SIGTERM to the parent process causes an exit.  There is some minimal work in that case to allow some time for the children to finish what they are doing.

When started looks for the following config parameters in run/procmanager

setgidgroupid to change to after forking
setgiduserid to change to after forking
portport to bind to (“socket” overrides this)
socketunix socket path to bind to (stronger than “port”)
maxrequeststerminating child after this number of requests (please use this, it helps to kill memory leaks)
processesnumber of preforked children

Keeps its main pid in “$BASEPATH/run.pid”.  (TODO : make this a parameter!)

Please note that the current implementation of FCGI::ProcManager is somewhat broken : the getppid call in the code of FCGI::ProcManager terminates the base process when the parent process dies.  Some hackery is done here to avoid that.

Summary
PET::RUN::FCGIProcManagerThis package to run PET in FCGI mode, using FCGI::ProcManager.
Variables
$DISPAn instance if PET::Dispatcher
$COUNTERCount number of requests before killing child.
$MAXREQUESTSNumber of max.
Functions
run ()Called by external script pet_run_fcgiprocmanager.
dorequest ()Execute one call.

Variables

$DISP

my $DISP

An instance if PET::Dispatcher

$COUNTER

my $COUNTER

Count number of requests before killing child.

$MAXREQUESTS

my $MAXREQUESTS

Number of max. requests to serve.

Functions

run ()

sub run

Called by external script pet_run_fcgiprocmanager.  Starts daemon and exits.

dorequest ()

sub dorequest

Execute one call.  Prints what is returned from $DISP->doRequest() .

my $DISP
An instance if PET::Dispatcher
my $COUNTER
Count number of requests before killing child.
my $MAXREQUESTS
Number of max.
sub run
Called by external script pet_run_fcgiprocmanager.
sub dorequest
Execute one call.
Close