Logoj0ke.net Open Build Service > Projects > server:monitoring > snmptt > snmptrapd.init-suse
Sign Up | Log In

File snmptrapd.init-suse of Package snmptt

x
 
1
#!/bin/sh
2
#
3
# Autor: Ciro Iriarte <ciriarte@personal.com.py>
4
#
5
# /etc/init.d/snmptrapd
6
#
7
#   y el link simbolico
8
#
9
# /usr/sbin/rcsnmptrapd
10
#
11
### BEGIN INIT INFO
12
# Provides: snmptrapd
13
# Required-Start: $remote_fs $syslog $network
14
# Required-Stop:  $remote_fs $syslog
15
# Default-Start:  3 5
16
# Default-Stop:   0 1 2 6
17
# Description:    snmptrapd, para recibir traps
18
### END INIT INFO
19
20
. /etc/rc.status
21
OPTIONS="-On -Lf /var/log/snmptrapd.log"
22
BINARY="/usr/sbin/snmptrapd"
23
prog="snmptrapd"
24
test -x $BINARY || exit 5
25
26
case "$1" in
27
  start)
28
        echo -n "Starting $prog: "
29
        startproc $BINARY $OPTIONS
30
        rc_status -v
31
        ;;
32
  stop)
33
        echo -n "Stopping $prog: "
34
        killproc -TERM $BINARY
35
        rm -f /var/lock/subsys/snmptrapd
36
        rc_status -v
37
        ;;
38
  restart)
39
        $0 stop
40
        $0 start
41
        rc_status
42
        ;;
43
  reload)
44
        echo -n "Reload service $prog "
45
        killproc -HUP $BINARY
46
        rc_status -v
47
        ;;
48
  try-restart)
49
      ## Do a restart only if the service was active before.
50
      ## Note: try-restart is now part of LSB (as of 1.9).
51
      ## RH has a similar command named condrestart.
52
      $0 status
53
      if test $? = 0; then
54
              $0 restart
55
      else
56
              rc_reset        # Not running is not a failure.
57
      fi
58
      # Remember status and be quiet
59
      rc_status
60
      ;;
61
62
  status)
63
        echo -n "Checking for $prog "
64
        checkproc $BINARY
65
        rc_status -v
66
        ;;
67
  *)
68
        echo "Usage: $0 {start|stop|status|try-restart|restart|reload}"
69
        exit 1
70
        ;;
71
esac
72
73
rc_exit
74
75