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

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