[pve-devel] [PATCH manager 3/3] pvestatd: log 'warn's in update_status

Thomas Lamprecht t.lamprecht at proxmox.com
Fri May 20 12:07:40 CEST 2016


Else warnings from the status_cfg parser get totally lost, the user
has no idea why nothing is happening.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

 PVE/Service/pvestatd.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index 98e5844..6022fd7 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -294,6 +294,11 @@ sub update_status {
     my $err = $@;
     syslog('err', $err) if $err;
 
+    local $SIG{__WARN__} = sub {
+	my $message = shift;
+	syslog('warning', $message);
+    };
+
     my $status_cfg = PVE::Cluster::cfs_read_file('status.cfg');
 
     eval {
-- 
2.1.4





More information about the pve-devel mailing list