1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/bash
# cmu-snmp init file for snmptrapd
# WWH -- copied snmpd to snmptrapd and edited...
#
#
# chkconfig: - 41 41
# description: Simple Network Management Protocol (SNMP) Trap Daemon
#
# processname: snmptrapd
# config:
#
# Notes:
# 1) This should read a file: /etc/snmptrapd.conf
# 2) This is based on /etc/rc.d/init.d/snmpd
# 3) Starting snmptrapd should be via "daemon" but
# doing so never returns....
#
# Configuration items:
# A) LOCKFILE -- where the lock for this item should go
# typically /var/lock/subsys/snmptrapd
LOCKFILE=/var/lock/subsys/snmptrapd
# D) SDAEMON -- daemon to start
# typically /usr/bin/snmptrapd
SDAEMON=/usr/sbin/snmptrapd
# source function library
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting snmptrapd: "
$SDAEMON -s &
touch $LOCKFILE
echo
;;
stop)
echo -n "Shutting down snmptrapd: "
killproc snmptrapd
rm -f $LOCKFILE
echo
;;
restart)
$0 stop
$0 start
;;
status)
status snmptrapd
;;
*)
echo "Usage: snmptrapd {start|stop|restart|status}"
exit 1
esac
exit 0
|