pve-manager/www/manager/startup.pl
Dietmar Maurer eb3b3e2905 log errors from apache chilinit()
it seems that apache doesn not log error to the error log, so we catch
them an log to syslog
2011-08-24 12:14:05 +02:00

56 lines
1004 B
Perl
Executable File

#!/usr/bin/perl -w
use strict;
use PVE::SafeSyslog;
use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::Access;
use Apache2::Response;
use Apache2::Util;
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Log ();
use APR::Table ();
use ModPerl::Registry ();
use Apache2::Const -compile => ':common';
use APR::Const -compile => ':common';
initlog ('proxwww', 'daemon');
use PVE::pvecfg;
use PVE::REST;
use PVE::Cluster;
use PVE::INotify;
use PVE::RPCEnvironment;
sub childinit {
syslog ('info', "Starting new child $$");
eval {
PVE::INotify::inotify_init();
PVE::RPCEnvironment->init('pub');
};
my $err = $@;
syslog('err', $err) if $err;
}
sub childexit {
syslog ('info', "Finish child $$");
}
my $s = Apache2::ServerUtil->server;
$s->push_handlers(PerlChildInitHandler => \&childinit);
$s->push_handlers(PerlChildExitHandler => \&childexit);
1;