]> git.pld-linux.org Git - packages/corosync.git/blame - corosync.init
add static_libs bcond
[packages/corosync.git] / corosync.init
CommitLineData
bfd8c80e
JK
1#!/bin/sh
2#
3# corosync Corosync Cluster Engine
4#
5# chkconfig: 2345 21 79
6# description: Corosync Cluster Engine
7# processname: corosync
8#
9### BEGIN INIT INFO
10# Provides: corosync
11# Required-Start: $network $syslog
12# Required-Stop: $network $syslog
13# Default-Start:
14# Default-Stop:
15# Short-Description: Starts and stops Corosync Cluster Engine.
16# Description: Starts and stops Corosync Cluster Engine.
17### END INIT INFO
18
19# Source function library
20. /etc/rc.d/init.d/functions
21
22[ -f /etc/sysconfig/corosync ] && . /etc/sysconfig/corosync
23
24start() {
25 # Check if the service is already running?
26 if [ -f /var/lock/subsys/corosync ]; then
27 msg_already_running "Corosync Cluster Engine"
28 return
29 fi
bfd8c80e
JK
30 if grep -q nocluster /proc/cmdline ; then
31 show "Disabled on boot"
32 RETVAL=1
33 return
34 fi
35
36 msg_starting "Corosync Cluster Engine"
37 daemon /usr/sbin/corosync
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync
40}
41
42stop() {
43 if [ ! -f /var/lock/subsys/corosync ]; then
44 msg_not_running "Corosync Cluster Engine"
45 return
46 fi
47
48 # Stop daemons.
49 msg_stopping "Corosync Cluster Engine"
50 killproc /usr/sbin/corosync
51 rm -f /var/lock/subsys/corosync
52}
53
54condrestart() {
55 if [ ! -f /var/lock/subsys/corosync ]; then
56 msg_not_running "Corosync Cluster Engine"
57 RETVAL=$1
58 return
59 fi
60
61 stop
62 start
63}
64
65case "$1" in
66 start)
67 start
68 ;;
69 stop)
70 stop
71 ;;
72 restart)
73 stop
74 sleep 5
75 start
76 ;;
77 try-restart)
78 condrestart 0
79 ;;
80 force-reload)
81 condrestart 7
82 ;;
83 status)
84 status corosync
85 RETVAL=$?
86 ;;
87*)
88 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
89 exit 3
90 ;;
91esac
92exit $RETVAL
This page took 0.102199 seconds and 4 git commands to generate.