]> git.pld-linux.org Git - packages/corosync.git/blame - corosync.init
- systemd unit files added
[packages/corosync.git] / corosync.init
CommitLineData
cba26dd3 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
30 if [ -f /var/lock/subsys/openais ]; then
31 msg_already_running "Corosync Cluster Engine (as openais)"
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 msg_starting "Corosync Cluster Engine"
41 daemon /usr/sbin/corosync
42 RETVAL=$?
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync
44}
45
46stop() {
47 if [ ! -f /var/lock/subsys/corosync ]; then
48 msg_not_running "Corosync Cluster Engine"
49 return
50 fi
51
52 # Stop daemons.
53 msg_stopping "Corosync Cluster Engine"
54 killproc /usr/sbin/corosync
55 rm -f /var/lock/subsys/corosync
56}
57
58condrestart() {
59 if [ ! -f /var/lock/subsys/corosync ]; then
60 msg_not_running "Corosync Cluster Engine"
61 RETVAL=$1
62 return
63 fi
64
65 stop
66 start
67}
68
69case "$1" in
70 start)
71 start
72 ;;
73 stop)
74 stop
75 ;;
76 restart)
77 stop
78 sleep 5
79 start
80 ;;
81 try-restart)
82 condrestart 0
83 ;;
84 force-reload)
85 condrestart 7
86 ;;
87 status)
88 status corosync
89 RETVAL=$?
90 ;;
91*)
92 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
93 exit 3
94 ;;
95esac
96exit $RETVAL
This page took 0.041599 seconds and 4 git commands to generate.