]> git.proxmox.com Git - redhat-cluster-pve.git/blame - debian/patches/fix-rgmanager-init.diff
update to STABLE32 3.1.92
[redhat-cluster-pve.git] / debian / patches / fix-rgmanager-init.diff
CommitLineData
3e8a6763
DM
1Index: new/rgmanager/init.d/rgmanager.in
2===================================================================
f3b46368
DM
3--- new.orig/rgmanager/init.d/rgmanager.in 2012-06-13 15:50:21.000000000 +0200
4+++ new/rgmanager/init.d/rgmanager.in 2012-06-13 15:58:49.000000000 +0200
f32778ad
DM
5@@ -6,10 +6,10 @@
6 #
7 ### BEGIN INIT INFO
3e8a6763 8 # Provides: rgmanager
f3b46368
DM
9-# Required-Start: cman cpglockd
10-# Required-Stop: cman cpglockd
3e8a6763
DM
11-# Default-Start:
12-# Default-Stop:
f3b46368
DM
13+# Required-Start: $remote_fs cman cpglockd
14+# Required-Stop: $remote_fs cman cpglockd
f32778ad
DM
15+# Default-Start: 2 3 4 5
16+# Default-Stop: 0 1 6
3e8a6763
DM
17 # Short-Description: Starts and stops Red Hat Service (resource group) Manager
18 # Description: Starts and stops Red Hat Service (resource group) Manager
19 ### END INIT INFO
20@@ -20,6 +20,10 @@
21 # set secure PATH
22 PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBINDIR@"
23
24+CCFG="/etc/cluster/cluster.conf"
25+
26+test -f "$CCFG" || exit 0
27+
28 success()
29 {
30 echo -ne "[ OK ]\r"
3e8a6763
DM
31@@ -52,8 +56,7 @@
32
33 # deb based distros
34 if [ -d /etc/default ]; then
35- [ -f /etc/default/cluster ] && . /etc/default/cluster
36- [ -f /etc/default/rgmanager ] && . /etc/default/rgmanager
37+ [ -f /etc/default/redhat-cluster-pve ] && . /etc/default/redhat-cluster-pve
38 [ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/rgmanager"
39 fi
40
f3b46368
DM
41@@ -82,6 +85,11 @@
42 while ! cpglockdump > /dev/null 2>&1; do sleep 1; done
3e8a6763
DM
43 }
44
45+rgmanager_enabled()
46+{
47+ ccs_tool query /cluster/rm >/dev/null 2>&1
48+}
49+
50 rtrn=0
51
52 if [ "$EUID" != "0" ]; then
f3b46368 53@@ -91,6 +99,11 @@
3e8a6763
DM
54
55 case "$1" in
56 start)
57+
58+ if ! rgmanager_enabled; then
59+ exit 0;
60+ fi
61+
62 echo -n "Starting $ID: "
63
64 # most recent distributions use tmpfs for /var/run
f3b46368 65@@ -107,7 +120,9 @@
3e8a6763
DM
66 if status $RGMGRD > /dev/null 2>&1; then
67 success
68 else
69- if $RGMGRD $RGMGR_OPTS; then
70+ # do not trust return code
71+ $RGMGRD $RGMGR_OPTS;
72+ if status $RGMGRD > /dev/null 2>&1; then
73 touch $LOCK_FILE
74 success
75 else
f3b46368 76@@ -141,11 +156,12 @@
3e8a6763
DM
77 echo -n "Stopping $ID: "
78
79 if status $RGMGRD > /dev/null 2>&1; then
80- if stop_cluster; then
81- success
82- else
83- failure
84+ stop_cluster
85+ if status $RGMGRD > /dev/null 2>&1; then
86+ failure
87 rtrn=1
88+ else
89+ success
90 fi
91 else
92 success