cluster: STABLE3 - Cman: test that corosync is not already running

Jan Friesse honzaf at fedoraproject.org
Wed Sep 29 10:24:31 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c09852206f21ed04806211e49ca9423e10fea1f9
Commit:        c09852206f21ed04806211e49ca9423e10fea1f9
Parent:        e88da89f1a5cdb8eb5e1924514401dfb91c0363c
Author:        Jan Friesse <jfriesse at redhat.com>
AuthorDate:    Mon Sep 27 15:23:49 2010 +0200
Committer:     Jan Friesse <jfriesse at redhat.com>
CommitterDate: Wed Sep 29 12:23:45 2010 +0200

Cman: test that corosync is not already running

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(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 7dae24d..6dfc119 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -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


More information about the cluster-commits mailing list