Blame SOURCES/bz1138871-mysql-error-validation-fails-monitor.patch

c608c9
From 6ac8332d16837a3481341316e61962e6f78694dd Mon Sep 17 00:00:00 2001
c608c9
From: David Vossel <dvossel@redhat.com>
c608c9
Date: Tue, 7 Oct 2014 16:11:19 -0400
c608c9
Subject: [PATCH 1/2] High: mysql: report error when validation fails during
c608c9
 monitor yet pid is still active
c608c9
c608c9
---
c608c9
 heartbeat/mysql | 11 ++++++++++-
c608c9
 1 file changed, 10 insertions(+), 1 deletion(-)
c608c9
c608c9
diff --git a/heartbeat/mysql b/heartbeat/mysql
c608c9
index 6cfe0a0..d895369 100755
c608c9
--- a/heartbeat/mysql
c608c9
+++ b/heartbeat/mysql
c608c9
@@ -1007,7 +1007,16 @@ LSB_STATUS_STOPPED=3
c608c9
 if [ $rc -ne 0 ]; then
c608c9
     case "$1" in
c608c9
         stop) ;;
c608c9
-        monitor) exit $OCF_NOT_RUNNING;;
c608c9
+        monitor)
c608c9
+            mysql_common_status "info"
c608c9
+            if [ $? -eq $OCF_SUCCESS ]; then
c608c9
+                # if validatation fails and pid is active, always treat this as an error
c608c9
+                ocf_exit_reason "environment validation failed, active pid is in unknown state."
c608c9
+                exit $OCF_ERR_GENERIC
c608c9
+            fi
c608c9
+            # validation failed and pid is not active, it's safe to say this instance is inactive.
c608c9
+            exit $OCF_NOT_RUNNING;;
c608c9
+
c608c9
         status) exit $LSB_STATUS_STOPPED;;
c608c9
         *) exit $rc;;
c608c9
     esac
c608c9
-- 
c608c9
1.8.4.2
c608c9