Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 414703 - net-analyzer/net-snmp-5.4.2.1-r4: bashism redirection in /etc/init.d/snmp
Summary: net-analyzer/net-snmp-5.4.2.1-r4: bashism redirection in /etc/init.d/snmp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-05-05 10:43 UTC by Outer Measure
Modified: 2012-08-03 11:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Outer Measure 2012-05-05 10:43:31 UTC
/etc/init.d/snmp contains the following bashism redirection:

(line 45)       kill -HUP $(< ${SNMPD_PIDFILE}) &>/dev/null

which POSIX shell would interpret as

kill -HUP $(< ${SNMPD_PIDFILE}) & > /dev/null

This probably affect other versions of net-snmp too.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-05 16:29:50 UTC
Index: files/snmpd.init
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.init,v
retrieving revision 1.2
diff -u -B -r1.2 snmpd.init
--- files/snmpd.init    4 Dec 2011 10:17:16 -0000       1.2
+++ files/snmpd.init    5 May 2012 16:29:35 -0000
@@ -42,6 +42,6 @@
        fi
 
        ebegin "Reloading ${SVCNAME} configuration"
-       kill -HUP $(< ${SNMPD_PIDFILE}) &>/dev/null
+       kill -HUP $(< ${SNMPD_PIDFILE}) 2>&1 > /dev/null
        eend $?
 }
Comment 2 Outer Measure 2012-05-06 19:39:15 UTC
Actually $(< ${SNMPD_PIDFILE}) is also bashism and does not work in, for example, dash (it returns the empty string).  So it probably should be

+       kill -HUP $(cat ${SNMPD_PIDFILE}) 2>&1 > /dev/null

instead.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-03 11:52:22 UTC
Fixed without revision/version bumps. Thanks for reporting and for the patch(es).