Skip to contentSkip to conversation

Cman: test that corosync is not already running

PATCH New Fabio M. Di Nitto 1 participant 2 messages Jan 6, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cman: test that corosync is not already running

From: Jan Friesse <[email protected]>

Patch fixes init file so now before cman start is tested, if corosync is running. If so, init script will refuse to start.

Resolves: rhbz#617234

---
 cman/init.d/cman.in |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
cman/init.d/cman.in +14 -0
index 7dae24d..6dfc119 100644
@@ -521,11 +521,25 @@ stop_configfs()
 	fi
 }
 
+corosync_running()
+{
+	[ -f /var/run/corosync.pid ] || return 1
+
+	read corosync_pid foo < /var/run/corosync.pid
+	if [ "$(pidof corosync)" == "$corosync_pid" ];then
+		errmsg="Corosync Cluster Engine is already running"
+		return 0
+	fi
+
+	return 1
+}
+
 start_cman()
 {
 	check_exec cman_tool || return $?
 	cman_running && return 0
 	cman_checkconfig || return 1
+	corosync_running && return 1
 
 	tmpfile=$(mktemp -t cmanstartup.XXXXXXXXXX)
 	if [ -z "$tmpfile" ]; then
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 Cman: test that corosync is not already running

Re-iterating the patch for ACK to go in RHEL6.

Fabio

Quoted 40 lines · Fabio M. Di Nitto

From: Jan Friesse <[email protected]>

Patch fixes init file so now before cman start is tested, if corosync is running. If so, init script will refuse to start.

Resolves: rhbz#617234

---
 cman/init.d/cman.in |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
cman/init.d/cman.in +14 -0
index 7dae24d..6dfc119 100644
@@ -521,11 +521,25 @@ stop_configfs()
 	fi
 }
 
+corosync_running()
+{
+	[ -f /var/run/corosync.pid ] || return 1
+
+	read corosync_pid foo < /var/run/corosync.pid
+	if [ "$(pidof corosync)" == "$corosync_pid" ];then
+		errmsg="Corosync Cluster Engine is already running"
+		return 0
+	fi
+
+	return 1
+}
+
 start_cman()
 {
 	check_exec cman_tool || return $?
 	cman_running && return 0
 	cman_checkconfig || return 1
+	corosync_running && return 1
 
 	tmpfile=$(mktemp -t cmanstartup.XXXXXXXXXX)
 	if [ -z "$tmpfile" ]; then