aboutsummaryrefslogtreecommitdiffstats
path: root/main/net-snmp/snmpd.initd
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2014-01-03 13:51:57 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2014-01-03 13:52:09 +0000
commit92cf69a075d0baaf47f6d2870ce07b6de3b83248 (patch)
treef1d0c677657a553b81f4bad43f09301fb3de85bb /main/net-snmp/snmpd.initd
parentbc44281cc77d7a50f8db4d85de387b241b3d7303 (diff)
downloadaports-92cf69a075d0baaf47f6d2870ce07b6de3b83248.tar.bz2
aports-92cf69a075d0baaf47f6d2870ce07b6de3b83248.tar.xz
main/net-snmp: update initd, adding reload function
Diffstat (limited to 'main/net-snmp/snmpd.initd')
-rw-r--r--main/net-snmp/snmpd.initd28
1 files changed, 17 insertions, 11 deletions
diff --git a/main/net-snmp/snmpd.initd b/main/net-snmp/snmpd.initd
index f768bb36bf..c4604c98b4 100644
--- a/main/net-snmp/snmpd.initd
+++ b/main/net-snmp/snmpd.initd
@@ -1,7 +1,15 @@
#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.init.2,v 1.3 2012/10/22 02:57:05 flameeyes Exp $
-NAME=snmpd
-DAEMON=/usr/sbin/$NAME
+SNMPD_PIDFILE="${SNMPD_PIDFILE:-/var/run/snmpd.pid}"
+
+extra_started_commands="reload"
+
+command="/usr/sbin/snmpd"
+command_args="-p ${SNMPD_PIDFILE} ${SNMPD_FLAGS}"
+pidfile="${SNMPD_PIDFILE}"
depend() {
use logger
@@ -11,21 +19,19 @@ depend() {
checkconfig() {
if [ ! -e /etc/snmp/snmpd.conf ] ; then
- eerror "You need an /etc/snmp/snmpd.conf config file to run snmpd"
+ eerror "${SVCNAME} requires an /etc/snmp/snmpd.conf configuration file"
return 1
fi
}
-start() {
+start_pre() {
checkconfig || return 1
- ebegin "Starting ${NAME}"
- start-stop-daemon --start --quiet --background \
- --exec ${DAEMON} -- -p /var/run/${NAME}.pid ${OPTS}
- eend $?
}
-stop() {
- ebegin "Stopping ${NAME}"
- start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading ${SVCNAME} configuration"
+ kill -HUP $(cat ${SNMPD_PIDFILE}) 2>&1 > /dev/null
eend $?
}