]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
netsnmp: fix stop and restart actions in init script
authorLuca Ceresoli <luca@lucaceresoli.net>
Wed, 31 Aug 2011 19:46:38 +0000 (21:46 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 11 Sep 2011 21:09:06 +0000 (23:09 +0200)
/etc/init.d/S59snmpd stop (and restart) currently fail if either snmpd or
snmptrapd are not running.
This is because start-stop-daemon -K returns nonzero if the process to be
killed is not running, and this causes the whole script to fail because it runs
under 'set -e'.

This may not be noticed if only the last start-stop-daemon fails, but this is
in general wrong. It would also cause a failure in other scripts that execute
S59snmpd and check the return value.

Adding the --oknodo (-o) option to start-stop-daemon fixes this.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/netsnmp/S59snmpd

index f65317a1d8b2c6952d7e5c11f82da39ffddbde06..5df4b854d6ee9de204eff13f0ee1516e7565debb 100755 (executable)
@@ -29,7 +29,6 @@ TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
 [ -r /etc/default/snmpd ] && . /etc/default/snmpd
 
 ssd_oknodo="-o"
-ssd_oknodo=""
 
 # Cd to / before starting any daemons.
 cd /