| 1 |
#!/sbin/runscript
|
| 2 |
# Copyright 1999-2012 Gentoo Foundation
|
| 3 |
# Distributed under the terms of the GNU General Public License v2
|
| 4 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.init.2,v 1.2 2012/08/21 15:45:47 flameeyes Exp $
|
| 5 |
|
| 6 |
SNMPD_PIDFILE="${SNMPD_PIDFILE:-/var/run/snmpd.pid}"
|
| 7 |
|
| 8 |
extra_started_commands="reload"
|
| 9 |
|
| 10 |
command="/usr/sbin/snmpd"
|
| 11 |
command_args="-p ${SNMPD_PIDFILE} ${SNMPD_FLAGS}"
|
| 12 |
pidfile="${SNMPD_PIDFILE}"
|
| 13 |
|
| 14 |
depend() {
|
| 15 |
use logger
|
| 16 |
}
|
| 17 |
|
| 18 |
checkconfig() {
|
| 19 |
if [ ! -e /etc/snmp/snmpd.conf ] ; then
|
| 20 |
eerror "${SVCNAME} requires an /etc/snmp/snmpd.conf configuration file"
|
| 21 |
return 1
|
| 22 |
fi
|
| 23 |
}
|
| 24 |
|
| 25 |
start_pre() {
|
| 26 |
checkconfig || return 1
|
| 27 |
}
|
| 28 |
|
| 29 |
reload() {
|
| 30 |
checkconfig || return 1
|
| 31 |
|
| 32 |
ebegin "Reloading ${SVCNAME} configuration"
|
| 33 |
kill -HUP $(cat ${SNMPD_PIDFILE}) 2>&1 > /dev/null
|
| 34 |
eend $?
|
| 35 |
}
|