misc/155109: sysutils/munin-node looses $PATH after SIGHUP
Claudius Herder
claudius at ambtec.de
Mon Feb 28 01:20:08 UTC 2011
>Number: 155109
>Category: misc
>Synopsis: sysutils/munin-node looses $PATH after SIGHUP
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Feb 28 01:20:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Claudius Herder
>Release: 8.2-RELEASE
>Organization:
>Environment:
FreeBSD server.ambtec.de 8.2-RELEASE FreeBSD 8.2-RELEASE #7: Sat Feb 26 14:57:22 CET 2011 claudius at server.ambtec.de:/usr/obj/usr/src/sys/CUSTOM amd64
>Description:
newsyslog sends SIGHUP to /var/run/munin/munin-node.pid after rotating log files, this causes munin-node to loose $PATH and some plugins stop working as expected.
(ntp_kernel_err, ntp_kernel_pll_freq, ntp_kernel_pll_off, postfix_mailqueue, coretemp and dev_cpu_). I didn't checked all plugins, so maybe there are more affected by this problem.
>How-To-Repeat:
kill -HUP `cat /var/run/munin/munin-node.pid`
and check /var/log/munin-node.log for errors
>Fix:
the attached diff adds absolute paths to mentioned plugins as a workaround, maybe there is a better way to fix the $PATH issue?
Patch attached with submission follows:
diff -ruN munin-node.orig/files/patch-node-node.d.freebsd-coretemp.diff munin-node/files/patch-node-node.d.freebsd-coretemp.diff
--- munin-node.orig/files/patch-node-node.d.freebsd-coretemp.diff 2011-02-15 01:11:56.000000000 +0100
+++ munin-node/files/patch-node-node.d.freebsd-coretemp.diff 2011-02-28 00:55:35.818272000 +0100
@@ -1,11 +1,20 @@
---- ./plugins/node.d.freebsd/coretemp.in.orig 2011-02-14 23:51:14.000000000 +0100
-+++ ./plugins/node.d.freebsd/coretemp.in 2011-02-14 23:52:10.000000000 +0100
+--- ./plugins/node.d.freebsd/coretemp.in.orig 2009-04-01 14:24:27.000000000 +0200
++++ ./plugins/node.d.freebsd/coretemp.in 2011-02-28 00:50:40.800109873 +0100
+@@ -37,7 +37,7 @@
+ }
+
+ cpus() {
+- sysctl -N dev.cpu |
++ /sbin/sysctl -N dev.cpu |
+ awk -F. '$4 == "temperature" { print $3 }'
+ }
+
@@ -75,7 +75,7 @@
reqcpus
for cpu in $cpus ; do
echo -n "CPU$cpu.value "
- sysctl -n dev.cpu.$cpu.temperature
-+ sysctl -n dev.cpu.$cpu.temperature | tr -d 'C'
++ /sbin/sysctl -n dev.cpu.$cpu.temperature | tr -d 'C'
done
}
diff -ruN munin-node.orig/files/patch-node-node.d.freebsd-dev_cpu_.diff munin-node/files/patch-node-node.d.freebsd-dev_cpu_.diff
--- munin-node.orig/files/patch-node-node.d.freebsd-dev_cpu_.diff 2011-02-15 01:11:56.000000000 +0100
+++ munin-node/files/patch-node-node.d.freebsd-dev_cpu_.diff 2011-02-28 00:55:43.993308000 +0100
@@ -1,11 +1,20 @@
---- ./plugins/node.d.freebsd/dev_cpu_.in.orig 2011-02-15 00:02:38.000000000 +0100
-+++ ./plugins/node.d.freebsd/dev_cpu_.in 2011-02-15 00:03:19.000000000 +0100
+--- ./plugins/node.d.freebsd/dev_cpu_.in.orig 2009-09-16 12:04:17.000000000 +0200
++++ ./plugins/node.d.freebsd/dev_cpu_.in 2011-02-28 00:51:25.582132769 +0100
+@@ -39,7 +39,7 @@
+ }
+
+ cpus() {
+- sysctl -N dev.cpu | awk -F. '$4 == "'"$func"'" { print $3 }'
++ /sbin/sysctl -N dev.cpu | awk -F. '$4 == "'"$func"'" { print $3 }'
+ }
+
+ reqcpus() {
@@ -109,7 +109,7 @@
reqcpus
for cpu in $cpus ; do
echo -n "CPU$cpu.value "
- sysctl -n "dev.cpu.$cpu.$func"
-+ sysctl -n "dev.cpu.$cpu.$func" | tr -d 'C'
++ /sbin/sysctl -n "dev.cpu.$cpu.$func" | tr -d 'C'
done
}
diff -ruN munin-node.orig/files/patch-plugins__node.d__ntp_kernel_err.in munin-node/files/patch-plugins__node.d__ntp_kernel_err.in
--- munin-node.orig/files/patch-plugins__node.d__ntp_kernel_err.in 1970-01-01 01:00:00.000000000 +0100
+++ munin-node/files/patch-plugins__node.d__ntp_kernel_err.in 2011-02-28 01:05:26.023827000 +0100
@@ -0,0 +1,17 @@
+--- ./plugins/node.d/ntp_kernel_err.in.orig 2011-02-28 00:35:09.994732672 +0100
++++ ./plugins/node.d/ntp_kernel_err.in 2011-02-28 00:36:06.910859461 +0100
+@@ -33,7 +33,7 @@
+
+ if [ "$1" = "autoconf" ]; then
+ # Not all ntpdc's are equal
+- ntpdc -c kern 2>/dev/null |
++ /usr/sbin/ntpdc -c kern 2>/dev/null |
+ awk 'BEGIN { ev=1; }
+ /^estimated error:/ { ev=0; }
+ END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
+@@ -51,4 +51,4 @@
+ fi
+
+ echo -n 'ntp_err.value '
+-ntpdc -c kern | awk '/^estimated error:/ { print $3 }'
++/usr/sbin/ntpdc -c kern | awk '/^estimated error:/ { print $3 }'
diff -ruN munin-node.orig/files/patch-plugins__node.d__ntp_kernel_pll_freq.diff munin-node/files/patch-plugins__node.d__ntp_kernel_pll_freq.diff
--- munin-node.orig/files/patch-plugins__node.d__ntp_kernel_pll_freq.diff 1970-01-01 01:00:00.000000000 +0100
+++ munin-node/files/patch-plugins__node.d__ntp_kernel_pll_freq.diff 2011-02-28 00:56:12.008994000 +0100
@@ -0,0 +1,17 @@
+--- ./plugins/node.d/ntp_kernel_pll_freq.in.orig 2011-02-28 00:35:10.015020687 +0100
++++ ./plugins/node.d/ntp_kernel_pll_freq.in 2011-02-28 00:36:34.236694522 +0100
+@@ -39,7 +39,7 @@
+ # $Id: ntp_kernel_pll_freq.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+ if [ "$1" = "autoconf" ]; then
+- ntpdc -c kern 2>/dev/null |
++ /usr/sbin/ntpdc -c kern 2>/dev/null |
+ awk 'BEGIN { ev=1; }
+ /^pll frequency:/ { ev=0; }
+ END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
+@@ -64,4 +64,4 @@
+ fi
+
+ echo -n 'ntp_pll_freq.value '
+-ntpdc -c kern | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
++/usr/sbin/ntpdc -c kern | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
diff -ruN munin-node.orig/files/patch-plugins__node.d__ntp_kernel_pll_off.diff munin-node/files/patch-plugins__node.d__ntp_kernel_pll_off.diff
--- munin-node.orig/files/patch-plugins__node.d__ntp_kernel_pll_off.diff 1970-01-01 01:00:00.000000000 +0100
+++ munin-node/files/patch-plugins__node.d__ntp_kernel_pll_off.diff 2011-02-28 00:56:19.007663000 +0100
@@ -0,0 +1,17 @@
+--- ./plugins/node.d/ntp_kernel_pll_off.in.orig 2011-02-28 00:35:10.035351721 +0100
++++ ./plugins/node.d/ntp_kernel_pll_off.in 2011-02-28 00:36:46.023122495 +0100
+@@ -32,7 +32,7 @@
+ # $Id: ntp_kernel_pll_off.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+ if [ "$1" = "autoconf" ]; then
+- ntpdc -c kern 2>/dev/null |
++ /usr/sbin/ntpdc -c kern 2>/dev/null |
+ awk 'BEGIN { ev=1; }
+ /^pll offset:/ { ev=0; }
+ END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
+@@ -50,4 +50,4 @@
+ fi
+
+ echo -n 'ntp_pll_off.value '
+-ntpdc -c kern | awk '/^pll offset:/ { print $3 }'
++/usr/sbin/ntpdc -c kern | awk '/^pll offset:/ { print $3 }'
diff -ruN munin-node.orig/files/patch-plugins__node.d__postfix_mailqueue.diff munin-node/files/patch-plugins__node.d__postfix_mailqueue.diff
--- munin-node.orig/files/patch-plugins__node.d__postfix_mailqueue.diff 1970-01-01 01:00:00.000000000 +0100
+++ munin-node/files/patch-plugins__node.d__postfix_mailqueue.diff 2011-02-28 01:10:18.691155000 +0100
@@ -0,0 +1,11 @@
+--- ./plugins/node.d/postfix_mailqueue.in.orig 2011-02-28 00:48:36.935940082 +0100
++++ ./plugins/node.d/postfix_mailqueue.in 2011-02-28 00:49:17.298330137 +0100
+@@ -84,7 +84,7 @@
+ # atempt to get spooldir via postconf, but environment overrides.
+
+ # Remember that postconf is not available unless postfix is.
+-POSTCONFSPOOL="$(postconf -h queue_directory 2>/dev/null || echo /var/spool/postfix)"
++POSTCONFSPOOL="$(/usr/local/sbin/postconf -h queue_directory 2>/dev/null || echo /var/spool/postfix)"
+ SPOOLDIR=${spooldir:-$POSTCONFSPOOL}
+
+ . $MUNIN_LIBDIR/plugins/plugin.sh
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list