pvestatd: log warnings to syslog

This commit is contained in:
Dietmar Maurer 2016-10-26 15:58:23 +02:00
parent e0dc09ad0f
commit 780fbb4b2a

View File

@ -5,8 +5,18 @@ use warnings;
use PVE::INotify;
use PVE::RPCEnvironment;
use PVE::SafeSyslog;
use PVE::Service::pvestatd;
$SIG{'__WARN__'} = sub {
my $err = $@;
my $t = $_[0];
chomp $t;
print STDERR "$t\n";
syslog('warning', "%s", $t);
$@ = $err;
};
my $prepare = sub {
my $rpcenv = PVE::RPCEnvironment->init('priv');