Blame SOURCES/bz1745713-rabbitmq-cluster-6-debug-log-mnesia-query-fails.patch

734564
From 2b6e4a94c847129dd014a1efa733cd1b4a2448e6 Mon Sep 17 00:00:00 2001
734564
From: John Eckersberg <jeckersb@redhat.com>
734564
Date: Fri, 2 Nov 2018 10:11:41 -0400
734564
Subject: [PATCH] rabbitmq-cluster: debug log detailed output when mnesia query
734564
 fails
734564
734564
---
734564
 heartbeat/rabbitmq-cluster | 4 +++-
734564
 1 file changed, 3 insertions(+), 1 deletion(-)
734564
734564
diff --git a/heartbeat/rabbitmq-cluster b/heartbeat/rabbitmq-cluster
734564
index 78b2bbadf..fabfeedfb 100755
734564
--- a/heartbeat/rabbitmq-cluster
734564
+++ b/heartbeat/rabbitmq-cluster
734564
@@ -191,7 +191,8 @@ rmq_app_running() {
734564
 rmq_monitor() {
734564
 	local rc
734564
 
734564
-	if $RMQ_CTL eval 'rabbit_mnesia:cluster_status_from_mnesia().' | grep -q '^{ok'; then
734564
+	status=$($RMQ_CTL eval 'rabbit_mnesia:cluster_status_from_mnesia().' 2>&1)
734564
+	if echo "${status}" | grep -q '^{ok'; then
734564
 		pcs_running=$(rmq_join_list | wc -w)
734564
 		ocf_log debug "Pacemaker thinks ${pcs_running} RabbitMQ nodes are running"
734564
 		rmq_running=$($RMQ_CTL eval 'length(mnesia:system_info(running_db_nodes)).')
734564
@@ -209,6 +210,7 @@ rmq_monitor() {
734564
 		return $OCF_SUCCESS
734564
 	else
734564
 		ocf_log info "RabbitMQ server could not get cluster status from mnesia"
734564
+		ocf_log debug "${status}"
734564
 		rmq_delete_nodename
734564
 		return $OCF_NOT_RUNNING
734564
 	fi