]> git.pld-linux.org Git - packages/corosync.git/blob - corosync-notifyd.init
corosync is not connected to openais any more
[packages/corosync.git] / corosync-notifyd.init
1 #!/bin/sh
2 #
3 # corosync-notifyd      Corosync Dbus and snmp notifier
4 #
5 # chkconfig: 2345 23 77
6 # description: Corosync Dbus and snmp notifier
7 # processname: corosync-notifyd-notifyd
8 #
9 ### BEGIN INIT INFO
10 # Provides:             corosync-notifyd-notifyd
11 # Required-Start:       $corosync-notifyd $cman
12 # Required-Stop:        $corosync-notifyd $cman
13 # Default-Start:
14 # Default-Stop:
15 # Short-Description:    Starts and stops Corosync Notifier.
16 # Description:          Starts and stops Corosync Notifier.
17 ### END INIT INFO
18
19 # Source function library
20 . /etc/rc.d/init.d/functions
21
22 SEND_SNMP_TRAPS=no
23 SEND_DBUS_SIGNALS=yes
24 LOG_ALL_EVENTS=no
25
26 [ -f /etc/sysconfig/corosync-notifyd ] && . /etc/sysconfig/corosync-notifyd
27
28 start() {
29         # Check if the service is already running?
30         if [ -f /var/lock/subsys/corosync-notifyd ]; then
31                 msg_already_running "Corosync Notifier"
32                 return
33         fi
34         if grep -q nocluster /proc/cmdline ; then
35                 show "Disabled on boot"
36                 RETVAL=1
37                 return
38         fi
39
40         local options=""
41         if is_yes "$SEND_SNMP_TRAPS" ; then
42                 options="$options -s"
43         fi
44         if [ -n "$SNMP_MANAGER" ] ; then
45                 options="$options -m $SNMP_MANAGER"
46         fi
47         if is_yes "$SEND_DBUS_SIGNALS" ; then
48                 options="$options -d"
49         fi
50         if is_yes "$LOG_ALL_EVENTS" ; then
51                 options="$options -l"
52         fi
53         msg_starting "Corosync Notifier"
54         daemon /usr/sbin/corosync-notifyd "$options"
55         RETVAL=$?
56         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync-notifyd
57 }
58
59 stop() {
60         if [ ! -f /var/lock/subsys/corosync-notifyd ]; then
61                 msg_not_running "Corosync Notifier"
62                 return
63         fi
64
65         # Stop daemons.
66         msg_stopping "Corosync Notifier"
67         killproc /usr/sbin/corosync-notifyd
68         rm -f /var/lock/subsys/corosync-notifyd
69 }
70
71 condrestart() {
72         if [ ! -f /var/lock/subsys/corosync-notifyd ]; then
73                 msg_not_running "Corosync Notifier"
74                 RETVAL=$1
75                 return
76         fi
77
78         stop
79         start
80 }
81
82 case "$1" in
83   start)
84         start
85         ;;
86   stop)
87         stop
88         ;;
89   restart)
90         stop
91         sleep 5
92         start
93         ;;
94   try-restart)
95         condrestart 0
96         ;;
97   force-reload)
98         condrestart 7
99         ;;
100   status)
101         status corosync-notifyd
102         RETVAL=$?
103         ;;
104 *)
105         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
106         exit 3
107         ;;
108 esac
109 exit $RETVAL
This page took 0.060822 seconds and 3 git commands to generate.