]> git.pld-linux.org Git - packages/net-snmp.git/blame - net-snmptrapd.init
- removed duplicates of perl manuals from -devel
[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.
bde59677 24if is_yes "${NETWORKING}"; then
8d056991 25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
bde59677 26 msg_network_down "snmptrapd"
27 exit 1
28 fi
29else
30 exit 0
43f17c64
AF
31fi
32
04a4ae24 33RETVAL=0
43f17c64
AF
34# See how we were called.
35case "$1" in
36 start)
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/snmptrapd ]; then
39 msg_starting "snmptrapd"
40 daemon /usr/sbin/snmptrapd
41 RETVAL=$?
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmptrapd
43 else
44 msg_already_running "snmptrapd"
43f17c64
AF
45 fi
46 ;;
47 stop)
48 if [ -f /var/lock/subsys/snmptrapd ]; then
49 msg_stopping "snmptrapd"
50 killproc snmptrapd
51 rm -f /var/lock/subsys/snmptrapd >/dev/null 2>&1
52 else
53 msg_not_running "snmptrapd"
43f17c64
AF
54 fi
55 ;;
04a4ae24 56 restart|force-reload)
43f17c64
AF
57 $0 stop
58 $0 start
04a4ae24 59 exit $?
43f17c64
AF
60 ;;
61 status)
62 status snmptrapd
63 exit $?
64 ;;
65 *)
04a4ae24 66 msg_usage "$0 {start|stop|restart|force-reload|status}"
67 exit 3
43f17c64
AF
68esac
69
70exit $RETVAL
This page took 0.08863 seconds and 4 git commands to generate.