#!/bin/sh # The initial version: # Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany. All rights reserved. # # Additions: Dirk Wetter, http://drwetter.org, GNU-Copyleft # # /etc/init.d/snmptrapd # ### BEGIN INIT INFO # Provides: snmptrapd # Required-Start: $network # Required-Stop: # Default-Start: 3 5 # Default-Stop: # Description: start snmptrap daemon ### END INIT INFO SNMPTD_BIN=/usr/sbin/snmptrapd test -x $SNMPTD_BIN || exit 5 # default ARGS: facility LOG_DAEMON, priority LOG_NOTICE ARGS="-Ls d -LE n -Lf /var/log/net-snmpd.log" # to be consistent you should put ARGS into /etc/sysconfig/snmptrapd: test -x /etc/sysconfig/snmptrapd && . /etc/sysconfig/snmptrapd # Shell functions sourced from /etc/rc.status: . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -n "Starting snmptrapd" startproc $SNMPTD_BIN $ARGS rc_status -v ;; stop) echo -n "Shutting down snmptrapd" killproc -TERM $SNMPTD_BIN rc_status -v ;; restart) $0 stop $0 start rc_status ;; force-reload) $0 stop && $0 start rc_status ;; reload) rc_failed 3 rc_status -v ;; status) echo -n "Checking for snmptrapd: " checkproc $SNMPTD_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" exit 1 ;; esac rc_exit