Blame SOURCES/bz1659072-1-rabbitmq-cluster-debug-log-mnesia-query-fails.patch

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