aports/main/net-snmp/snmpd.initd
Leonardo Arena e244c32c82 main/net-snmp: remove legacy backward compatibility and modernize init
- Legacy SNMPD_FLAGS variable was removed 6 years ago
- Don't use /var/run anymore
- Run snmpd in foreground, so user has the option to run it under
supervise-daemon (not used by default)
2021-12-30 13:56:24 +01:00

22 lines
474 B
Bash

#!/sbin/openrc-run
: ${OPTS:="-LSwd -Lf /dev/null"}
pidfile="/run/${SVCNAME}.pid"
command="/usr/sbin/${SVCNAME}"
command_args="-f -p ${pidfile} ${OPTS}"
command_background="yes"
required_files="/etc/snmp/${SVCNAME}.conf"
extra_started_commands="reload"
depend() {
use logger
need net
after firewall
}
reload() {
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP --pidfile ${pidfile} --name ${SVCNAME}
eend $?
}