rabbitmq-server/pull-request-20.patch

51 lines
1.7 KiB
Diff
Raw Normal View History

From 6d9a00d54425b299c682af692c9fad413d9f5da4 Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Wed, 29 Mar 2017 21:44:32 +0200
Subject: [PATCH 1/2] OCF RA: Use rabbitmqctl_action wrapper for stop action
We want to use the wrapper function to call rabbitmqctl for stop, so
that we interpret correctly the exit code.
---
scripts/rabbitmq-server.ocf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/rabbitmq-server.ocf b/scripts/rabbitmq-server.ocf
index 804e654..284360b 100755
--- a/scripts/rabbitmq-server.ocf
+++ b/scripts/rabbitmq-server.ocf
@@ -299,7 +299,7 @@ rabbit_stop() {
return $OCF_SUCCESS
fi
- $RABBITMQ_CTL stop ${RABBITMQ_PID_FILE}
+ rabbitmqctl_action stop ${RABBITMQ_PID_FILE}
rc=$?
if [ "$rc" != 0 ]; then
From 3b9dcfc6653e7ae8e7ba9e2e738c9f7df30e5cce Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Wed, 29 Mar 2017 21:45:52 +0200
Subject: [PATCH 2/2] OCF RA: accept 1 as valid exit code from "rabbitmqctl
status"
It may return 1 if the server is not completely running yet, and we
don't want pacemaker to treat that as a complete unexpected error.
---
scripts/rabbitmq-server.ocf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/rabbitmq-server.ocf b/scripts/rabbitmq-server.ocf
index 284360b..bf8880d 100755
--- a/scripts/rabbitmq-server.ocf
+++ b/scripts/rabbitmq-server.ocf
@@ -256,7 +256,7 @@ rabbitmqctl_action() {
ocf_log debug "RabbitMQ server is running normally"
return $OCF_SUCCESS
;;
- 2)
+ 1|2)
ocf_log debug "RabbitMQ server is not running"
return $OCF_NOT_RUNNING
;;