Commit Graph

8 Commits

Author SHA1 Message Date
universe II
45136f3097 netsnmp: add OK/FAIL output in init script
This commit reworks the output of the start(), stop() and reload()
functions. The return values of start-stop-daemon are now checked and a
OK or FAIL message is printed out.

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-01 14:53:11 +02:00
universe II
6eba255b71 netsnmp: add missing reload of snmptrapd in init script
In case of a reload command the snmpdtrapd wasn't restarted.

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-01 14:49:24 +02:00
universe II
11d99e7257 netsnmp: remove 'set -e' from init script
This patch removes 'set -e' from the netsnmp init script since it causes
the init script to terminate if an error occurs. This prevents the
script to create an "FAIL" printout in case of an error.

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-01 14:47:58 +02:00
universe II
291f3f948d netsnmp: adjust init script by creating start(), stop(), reload()
Change the init script to get rid of double code. Start, stop and reload
code has been put into separate functions and 'restart' will just call
stop() and start() with a delay in between.

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-01 14:47:02 +02:00
Maxime Hadjinlian
0f75b2635e package: Replace 'echo -n' by 'printf'
'echo -n' is not a POSIX construct (no flag support), we shoud use
'printf', especially in init script.

This patch was generated by the following command line:
git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/'

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-04 00:56:41 +02:00
Danomi Manchego
9ef8f8e9c5 netsnmp: fix tab/space formatting in init.d script
The S59snmpd script has a strange mix of tabs and spaces.  Replace
tabs with spaces, and also remove unnecessary line continuations
from the start-stop-daemon lines, as none of them go beyond 80
columns.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-03-28 09:59:49 +01:00
Luca Ceresoli
77cc11d533 netsnmp: fix stop and restart actions in init script
/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>
2011-09-11 23:09:06 +02:00
Peter Korsgaard
30bb1bdca4 netsnmp: bump version
Based on fa86c12d in Bernhards tree.
2008-11-04 11:26:52 +00:00