From 780fbb4b2a140011169d47871078cec990878d90 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 26 Oct 2016 15:58:23 +0200 Subject: [PATCH] pvestatd: log warnings to syslog --- bin/pvestatd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/pvestatd b/bin/pvestatd index 98033ad9..5cd727e9 100755 --- a/bin/pvestatd +++ b/bin/pvestatd @@ -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');