diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init')
-rwxr-xr-x | meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init new file mode 100755 index 000000000..47995466f --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init @@ -0,0 +1,66 @@ +#! /bin/sh +# /etc/init.d/snmpd: start snmp daemon. + +. /etc/init.d/functions + +# Defaults +export MIBDIRS=/usr/share/snmp/mibs +SNMPDRUN=yes +SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid' +TRAPDRUN=no +TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid' +PIDFILE=/var/run/snmpd.pid +SPIDFILE=/var/run/snmptrapd.pid + +# Reads config file if exists (will override defaults above) +[ -r /etc/default/snmpd ] && . /etc/default/snmpd + +[ "$SNMPDRUN" = "yes" ] && { test -x /usr/sbin/snmpd || exit 0; } +[ "$TRAPDRUN" = "yes" ] && { test -x /usr/sbin/snmptrapd || exit 0; } + +case "$1" in + start) + echo -n "Starting network management services:" + if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf -a ! -f "$PIDFILE" ]; then + start-stop-daemon -o --start --quiet --name snmpd --pidfile "$PIDFILE" \ + --exec /usr/sbin/snmpd -- $SNMPDOPTS + echo -n " snmpd" + fi + if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf -a ! -f "$SPIDFILE" ]; then + start-stop-daemon -o --start --quiet --name snmptrapd --pidfile "$SPIDFILE" \ + --exec /usr/sbin/snmptrapd -- $TRAPDOPTS + echo -n " snmptrapd" + fi + echo "." + + test ! -x /sbin/restorecon || /sbin/restorecon -FR /var/lib/net-snmp + ;; + stop) + echo -n "Stopping network management services:" + if [ -f "$PIDFILE" ] ; then + start-stop-daemon -o --stop --quiet --pidfile $PIDFILE --name snmpd + fi + echo -n " snmpd" + if [ -f "$SPIDFILE" ] ; then + start-stop-daemon -o --stop --quiet --pidfile $SPIDFILE --name snmptrapd + rm -rf $SPIDFILE + fi + echo -n " snmptrapd" + echo "." + ;; + status) + status /usr/sbin/snmpd; + exit $? + ;; + restart|reload|force-reload) + $0 stop + # Allow the daemons time to exit completely. + sleep 2 + $0 start + ;; + *) + echo "Usage: /etc/init.d/snmpd {start|stop|status|restart|reload|force-reload}" + exit 1 +esac + +exit 0 |