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

File snmptt.init-suse of Package snmptt

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