Commit 92cf69a0 authored by Leonardo Arena's avatar Leonardo Arena

main/net-snmp: update initd, adding reload function

parent bc44281c
......@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=net-snmp
pkgver=5.7.2
pkgrel=1
pkgrel=2
pkgdesc="Simple Network Management Protocol"
url="http://www.net-snmp.org/"
arch="all"
......@@ -165,21 +165,21 @@ tools() {
md5sums="5bddd02e2f82b62daa79f82717737a14 net-snmp-5.7.2.tar.gz
bd7dc10ffb5839e35ec37effcc53c2ad netsnmp-swinst-crash.patch
0fe11859a55f8e2489d5de629971a242 fix-includes.patch
198a4a7b80557fa8112394df5ec9914e snmpd.initd
3676e4d2e456e88da0dee8d7204749ba snmpd.initd
96510a2f3bc9f21648b03f7e8d76c0d3 snmpd.confd
7ce3e9e880fc6313ae87eb000bae4bda snmptrapd.initd
363f7728a76bdfc46e29b7e1f5cf4950 snmptrapd.confd"
sha256sums="09ed31b4cc1f3c0411ef9a16eff79ef3b30d89c32ca46d5a01a41826c4ceb816 net-snmp-5.7.2.tar.gz
377e54bc2b66590c1c5174bf2e2c820adcbecd703d67c68be13c325d04d7d0c4 netsnmp-swinst-crash.patch
7528f7d368a0a4536915805c065f8496c37cb99dbc74d508bed89831cd5af37e fix-includes.patch
2fa0a1ecd5f64827592bf55f0416cb61c6eec114aadd3e9d20aa92ce71c3a09f snmpd.initd
0f36683e3ab9855ab16c6a9e7f5934145b7f65a02c3dd46dc9627b721296119a snmpd.initd
4a8eb647d8b8f25b03858e3815489eaf2cd8fd4932185f97a1d896f8ee2f85e8 snmpd.confd
4baf3ee9950ded78078d93c32833ff657d7e85580d64778cdc9a963cf24bc7ab snmptrapd.initd
095647b0e5be51e2bdd398267d7450da678b7d23cae6273f9b9461a26f89d69f snmptrapd.confd"
sha512sums="6cf9847c30d861f1c7002ca68f8317f84e7a7278ab78e92e6481a5296e0bf1e5f3525ec566002bd307d8d907699e9baef9f3919ba18d0948cc3bb550b99de882 net-snmp-5.7.2.tar.gz
78c036f1e6b4e3592cb2a6ff9b22671c930e337e9644298a9f78b6f13af1d9241d9c15dcc996b441b51cb2d551bf2dfe5caf602ff1e17baf7b6532f3dc6ba5bd netsnmp-swinst-crash.patch
87a552bd2e41684bba6e87fbcf6454a85ee912d7a339411fda24cebddf7661f0856729e076a917920a542cf84b687ffd90a091daa15f2c48f0ff64f3a53c0ddb fix-includes.patch
ad66fef217ad9884114e9006c20074288656cf79fae19b59941545bbb551adfaaf4ec54cd0802e096a715d35c49a7c94cd4369302f847b8ba2892bd9fb62848c snmpd.initd
887e84b775cd87a3631deac44aa35645c2df9b13b9346b2b23a80e513e82425304a79a8bf5234937f01638969788602539846e7fb8f9b5a9273c938a6233a175 snmpd.initd
3030ad11dd556569e481f108af69aef620b1fe67be8d8d12016f4aed1f0ffdb6c2ee87c40ed5bc883986568227e097cb7aa958658e01da51576848715bf65472 snmpd.confd
e9b29b89d27e88420932ea6ca077a6c807ae5555436cad4d840ec732b5851a498661d0d174f22d308f403904b623d7eadf9d201a539529ff57ced18bc8c58b6f snmptrapd.initd
9cafeece565ca09c2cc85fa9c805d9932a745aca45b999e7511ccd0ffe0a95eddc1441ed231acf52a811db124bc2f797612ebb182b0a8a959ad24506e790a0b1 snmptrapd.confd"
#!/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 $?
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment