ソースを参照

Check that Corosync was not runned by cman

Patch fixes init script so it's tested, if corosync was runned
by cman or not. If so, it refuses to stop Corosync.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3011 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jan Friesse 15 年 前
コミット
d6cd3b6b34
1 ファイル変更17 行追加0 行削除
  1. 17 0
      init/generic.in

+ 17 - 0
init/generic.in

@@ -99,10 +99,27 @@ start()
 	echo
 }
 
+executed_by_cman()
+{
+	[ -f @LOCALSTATEDIR@/run/cman.pid ] || return 0
+
+	read cman_pid foo < @LOCALSTATEDIR@/run/cman.pid
+	if [ "$(pidof $prog)" == "$cman_pid" ];then
+		echo -n "$desc was executed by cman"
+		failure
+		echo
+		return 1
+	fi
+
+	return 0
+}
+
 stop()
 {
 	! status $prog > /dev/null 2>&1 && return
 
+	! executed_by_cman && return
+
 	echo -n "Signaling $desc ($prog) to terminate: "
 	kill -TERM $(pidof $prog) > /dev/null 2>&1
 	success