control: tag -1 + patch

I had a closer look at the problem, and figured out why the warning
show up.  The issue is that $data in the call to Storable::nstore() is
undefined.  A fix for this is to wrap the call writing data in a if
(defined $data) condition like this:

diff -ur munin-2.0.21/master/lib/Munin/Master/Utils.pm 
munin-2.0.21-pere/master/lib/Munin/Master/Utils.pm
--- munin-2.0.21/master/lib/Munin/Master/Utils.pm       2014-04-22 
21:29:32.000000000 +0200
+++ munin-2.0.21-pere/master/lib/Munin/Master/Utils.pm  2014-10-10 
09:17:13.328179704 +0200
@@ -859,11 +859,13 @@
 
        my $storable_filename_tmp = $storable_filename . ".tmp.$$";
 
-       # Write datafile.storable, in network order to be architecture indep
-        Storable::nstore($data, $storable_filename_tmp);
+       if (defined $data) {
+               # Write datafile.storable, in network order to be architecture 
indep
+               Storable::nstore($data, $storable_filename_tmp);
 
-       # Atomic commit
-       rename ($storable_filename_tmp, $storable_filename);
+               # Atomic commit
+               rename ($storable_filename_tmp, $storable_filename);
+       }
 }
 
 sub munin_writeconfig_storable {

This get rid of the warning in the cron email triggered by trying to
store nothing in /var/lib/munin/htmlconf.storable.tmp.$pid.  But the
cron email is still sent out, this time with another and more
understandable message:

 [FATAL] There is nothing to do here, since there are no nodes with
 any plugins.  Please refer to http://munin-monitoring.org/wiki/FAQ_no_graphs

So one step forward, one step back.  But anyway, I suggest to include
the patch in munin, to avoid the confusing message.
-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to