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

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