Subject: munin-node: selinux_avcstats fails when /bin/sh is dash (bashism)
Package: munin-node
Version: 2.0.0-1~bpo60+1
Severity: normal

*** Please type your report below this line ***
Hello, today I upgraded from munin 1.4.5-3 (squeeze) to 2.0.0-1~bpo60+1
(squeeze-backports) and found the selinux_avcstats plugin to be broken.

Looks like the 1.4 version of the plugin used awk, and the 2.0 version replaces
use of awk with a couple shell 'read' builtins that don't work with dash.

Following is munin-node.log output:

2012/08/27-19:50:16 [17873] Error output from selinux_avcstat:
2012/08/27-19:50:16 [17873]     read: 111: arg count
2012/08/27-19:50:16 [17873]     /etc/munin/plugins/selinux_avcstat: 111: 
Illegal number: lookups
2012/08/27-19:50:16 [17873] Service 'selinux_avcstat' exited with status 2/0.

Sorry, normally I'd try and write a patch, but this particular shell-fu is much
greater than mine (braces, read-while-read?!):

    { read
      while read lookups hits misses allocations reclaims frees; do
        LOOKUPS=$(($LOOKUPS + $lookups))
        HITS=$(($HITS + $hits))
        MISSES=$(($MISSES + $misses))
        ALLOCATIONS=$(($ALLOCATIONS + $allocations))
        RECLAIMS=$(($RECLAIMS + $reclaims))
        FREES=$(($FREES + $frees))
      done
    } < $AVCSTATS

Kludgy work-around for me is replacing '#!/bin/sh' with '#!/bin/bash'.

BTW, thank you for backporting 2.0 to squeeze - my collection server is much
happier with new rrdcached backend :)

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

Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=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           2.0.0-1~bpo60+1   network-wide graphing framework (c
ii  munin-plugins-core [mu 2.0.0-1~bpo60+1   network-wide graphing framework (p
ii  munin-plugins-extra [m 2.0.0-1~bpo60+1   network-wide graphing framework (u
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
ii  munin-plugins-core       2.0.0-1~bpo60+1 network-wide graphing framework (p

Versions of packages munin-node suggests:
ii  acpi                    1.5-2            displays information on ACPI devic
ii  ethtool                 1:2.6.34-3       display or change Ethernet device 
ii  hdparm                  9.32-1           tune hard disk parameters for high
ii  libcache-cache-perl     1.06-1           Managed caches of persistent infor
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)
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)
ii  munin-plugins-extra     2.0.0-1~bpo60+1  network-wide graphing framework (u
pn  munin-plugins-java      <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)
ii  smartmontools           5.39.1+svn3124-2 control and monitor storage system

-- Configuration Files:
/etc/cron.d/munin-node changed [not included]
/etc/munin/munin-node.conf changed [not included]
/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

Attachment: pgpShjmPE8koP.pgp
Description: PGP signature

Reply via email to