Peter Vereshagin


 FCGI::Spawn - process manager/application server for FastCGI protocol.


Tried to get know satisfaction with bugzilla... There's no place to dig out that Bugzilla doesn't work out with FastCGI other than Bugzilla's own Bugzilla though. This is my ./run for daemontools by

        #!/usr/bin/perl -w
        use strict;
        use warnings;
        our $bugzillaDir; 
        BEGIN {
                $bugzillaDir = '/var/www/somepath/bugzilla';
                chdir $bugzillaDir or die $!;
        use lib '/var/www/lib/perl';
        use FCGI::Spawn;
        use lib $bugzillaDir;
        use Bugzilla;
        use Bugzilla::Flag;
        use Bugzilla::CGI;
        use Bugzilla::FlagType;
        use Bugzilla::Util;
        use Bugzilla::Config;
        use Bugzilla::Error;
        use Bugzilla::Template;
        use Bugzilla::User;
        use Bugzilla::DB qw(:DEFAULT :deprecated);
        use Carp; $SIG{__DIE__} = sub{ print @_; print Carp::longmess };
        my $spawn = FCGI::Spawn->new({ n_processes => 5, sock_name => "/tmp/spawner.sock", sock_chown => [qw/-1 10034/],
        $spawn -> spawn;

Why daemontools?

They have internal log-processing and automatical daemon restart on fault. Sure they posess control like stop/restart. Check em out and see. But those are not strictly necessary. Another reason is that i'm not experienced much with Perl daemons building like getting rid of STD* file handles and SIG* handling.


FCGI::Spawn is used to serve as a FastCGI process manager. Besides the features the FCGI::ProcManager posess itself, the FCGI::Spawn is targeted as web server admin understandable instance for building the own fastcgi server with copy-on-write memory sharing among forks and with single input parameters like socket path and processes number. Another thing to mention is that it is able to execute any file pointed by Web server ( FastCGI requester ). So we have the daemon that is hot ready for hosting providing :-)

Every other thing is explained in FCGI::ProcManager docs.


Be sure to have FCGI::ProcManager.


class or instance

new({hash parameters})

Constructs a new process manager. Takes an option hash of the sock_name and sock_chown initial parameter values, and passes the entire hash rest to ProcManager's constructor. The parameters are:

  • sock_name is the socket's path, the parameter for FCGI::OpenSocket;

  • sock_chown is the array reference which sets the parameters for chown on newly created socket, when needed.

Every other parameter is passed "as is" to the FCGI::ProcManager's constructor.


Fork a new process handling request like that being processed by web server.