Subject: munin-node: bind9_rndc fails if named.stats is on tmpfs after reboot
Package: munin-node
Version: 1.4.5-3
Severity: normal

*** Please type your report below this line ***
Hello, I have a simple patch to help with a situation where bind9
named.stats is on tmpfs (in my case, /var/run/named/named.stats) and
after a reboot the file wont exist until 'rndc stats' is run.  Since the
plugin opens the file prior to running the command, the plugin will exit
with a file not found error.

Patch simply tests if the file can be read, if not, execs 'rndc stats'
an extra time.

-- System Information:
Debian Release: 6.0.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages munin-node depends on:
ii  adduser                3.112+nmu2        add and remove users and groups
ii  gawk                   1:3.1.7.dfsg-5    GNU awk, a pattern scanning and pr
ii  libnet-server-perl     0.97-1            An extensible, general perl server
ii  lsb-base               3.2-23.2squeeze1  Linux Standard Base 3.2 init scrip
ii  munin-common           1.4.5-3           network-wide graphing framework (c
ii  perl                   5.10.1-17squeeze3 Larry Wall's Practical Extraction 
ii  procps                 1:3.2.8-9squeeze1 /proc file system utilities

Versions of packages munin-node recommends:
ii  libnet-snmp-perl              5.2.0-4    Script SNMP connections

Versions of packages munin-node suggests:
pn  acpi | lm-sensors       <none>           (no description available)
ii  ethtool                 1:2.6.34-3       display or change Ethernet device 
pn  hdparm                  <none>           (no description available)
pn  libcache-cache-perl     <none>           (no description available)
ii  libcrypt-ssleay-perl    0.57-2           Support for https protocol in LWP
pn  libdbd-mysql-perl       <none>           (no description available)
pn  libdbd-pg-perl          <none>           (no description available)
pn  liblwp-useragent-determ <none>           (no description available)
pn  libnet-irc-perl         <none>           (no description available)
ii  libnet-ssleay-perl      1.36-1           Perl module for Secure Sockets Lay
pn  libtext-csv-xs-perl     <none>           (no description available)
ii  libwww-perl             5.836-1          Perl HTTP/WWW client/server librar
ii  libxml-simple-perl      2.18-3           Perl module for reading and writin
ii  logtail                 1.3.13           Print log file lines that have not
pn  munin                   <none>           (no description available)
pn  munin-java-plugins      <none>           (no description available)
pn  munin-plugins-extra     <none>           (no description available)
pn  mysql-client            <none>           (no description available)
ii  net-tools               1.60-23          The NET-3 networking toolkit
ii  python                  2.6.6-3+squeeze7 interactive high-level object-orie
pn  ruby                    <none>           (no description available)
pn  smartmontools           <none>           (no description available)

-- Configuration Files:
/etc/cron.d/munin-node changed:
MAILTO=root

/etc/munin/munin-node.conf changed:
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid
background 1
setsid 1
user root
group root
ignore_file ~$
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
allow ^10\.10\.10\.10$
host *
port 4949

/etc/munin/plugin-conf.d/munin-node [Errno 13] Permission denied: 
u'/etc/munin/plugin-conf.d/munin-node'

-- no debconf information

-- 
Gerald Turner   Email: gtur...@unzane.com   JID: gtur...@unzane.com
GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
--- /usr/share/munin/plugins/bind9_rndc	2010-10-05 06:39:07.000000000 -0700
+++ /etc/munin/plugins/bind9_rndc	2012-08-21 16:45:49.000000000 -0700
@@ -69,6 +69,11 @@
     }
 }
 
+# check if log file doesn't exist and attempt to create it
+if ( ! -r $querystats ) {
+    system("$rndc stats");
+}
+
 # open the log file, and get its size
 open(my $stats, '<', $querystats) or die "$0: $querystats: $!\n";
 my $size = (stat $stats)[7];

Attachment: pgpSXDXfVzQqh.pgp
Description: PGP signature

Reply via email to