]> git.pld-linux.org Git - packages/net-snmp.git/blame - net-snmptrapd.init
initial
[packages/net-snmp.git] / net-snmptrapd.init
CommitLineData
43f17c64
AF
1#!/bin/sh
2#
3# ucd-snmptrapd Simple Network Management Protocol (SNMP) Trap Daemon
4#
5# chkconfig: 345 51 51
6#
7# description: Simple Network Management Protocol (SNMP) Trap Daemon
8#
9# processname: snmptrapd
10# config: /etc/snmp/snmptrapd.local.conf
11# config: /etc/snmp/snmptrapd.conf
12
13
14# Source function library
15. /etc/rc.d/init.d/functions
16
17# Get network config
18. /etc/sysconfig/network
19
20# Get service config
21[ -f /etc/sysconfig/snmpd ] && . /etc/sysconfig/snmptrapd
22
23# Check that networking is up.
24if is_no "${NETWORKING}"; then
25 msg_network_down "snmptrapd"
26 exit 1
27fi
28
29# See how we were called.
30case "$1" in
31 start)
32 # Check if the service is already running?
33 if [ ! -f /var/lock/subsys/snmptrapd ]; then
34 msg_starting "snmptrapd"
35 daemon /usr/sbin/snmptrapd
36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmptrapd
38 else
39 msg_already_running "snmptrapd"
40 exit 1
41 fi
42 ;;
43 stop)
44 if [ -f /var/lock/subsys/snmptrapd ]; then
45 msg_stopping "snmptrapd"
46 killproc snmptrapd
47 rm -f /var/lock/subsys/snmptrapd >/dev/null 2>&1
48 else
49 msg_not_running "snmptrapd"
50 exit 1
51 fi
52 ;;
53 restart|reload)
54 $0 stop
55 $0 start
56 ;;
57 status)
58 status snmptrapd
59 exit $?
60 ;;
61 *)
62 msg_usage "$0 {start|stop|status|restart|reload}"
63 exit 1
64esac
65
66exit $RETVAL
This page took 0.074002 seconds and 4 git commands to generate.