| Summary: | net-analyzer/net-snmp-5.4.2.1-r4: bashism redirection in /etc/init.d/snmp | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Outer Measure <outermeasure> |
| Component: | New packages | Assignee: | Gentoo Netmon project <netmon> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | Keywords: | PATCH |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
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 $?
}
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.
Fixed without revision/version bumps. Thanks for reporting and for the patch(es). |
/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.