Implemented Graham's fork-at-startup idea

This commit is contained in:
Paul Driver 2010-09-28 11:01:43 -07:00
parent 79de38dc4a
commit c8fd0b56ed
3 changed files with 263 additions and 188 deletions

View file

@ -17,19 +17,6 @@ unshift @INC, grep {
}
} readLines($webguiRoot."/sbin/preload.custom");
#----------------------------------------
# Logger
#----------------------------------------
require Log::Log4perl;
Log::Log4perl->init( $webguiRoot."/etc/log.conf" );
#----------------------------------------
# Database connectivity.
#----------------------------------------
#require Apache::DBI; # Uncomment if you want to enable connection pooling. Not recommended on servers with many sites, or those using db slaves.
require DBI;
DBI->install_driver("mysql"); # Change to match your database driver.
#----------------------------------------
# WebGUI modules.
#----------------------------------------
@ -48,6 +35,29 @@ WebGUI::Pluggable::findAndLoad( "WebGUI",
}
);
#----------------------------------------
# Preload all site configs.
#----------------------------------------
WebGUI::Config->loadAllConfigs($webguiRoot);
#----------------------------------------
# WebGUI::BackgroundProcess initialization
#----------------------------------------
WebGUI::BackgroundProcess->init();
#----------------------------------------
# Logger
#----------------------------------------
require Log::Log4perl;
Log::Log4perl->init( $webguiRoot."/etc/log.conf" );
#----------------------------------------
# Database connectivity.
#----------------------------------------
#require Apache::DBI; # Uncomment if you want to enable connection pooling. Not recommended on servers with many sites, or those using db slaves.
require DBI;
DBI->install_driver("mysql"); # Change to match your database driver.
require APR::Request::Apache2;
require Apache2::Cookie;
require Apache2::ServerUtil;
@ -64,12 +74,6 @@ $| = 1;
print "\nStarting WebGUI ".$WebGUI::VERSION."\n";
#----------------------------------------
# Preload all site configs.
#----------------------------------------
WebGUI::Config->loadAllConfigs($webguiRoot);
# reads lines from a file into an array, trimming white space and ignoring commented lines
sub readLines {
my $file = shift;