diff --git a/ocf-fixes.patch b/ocf-fixes.patch new file mode 100644 index 0000000..f200461 --- /dev/null +++ b/ocf-fixes.patch @@ -0,0 +1,22 @@ +Index: rabbitmq-server-2.8.7/rabbitmq-server.ocf +=================================================================== +--- rabbitmq-server-2.8.7.orig/rabbitmq-server.ocf ++++ rabbitmq-server-2.8.7/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 + ;; +@@ -299,7 +299,7 @@ rabbit_stop() { + return $OCF_SUCCESS + fi + +- $RABBITMQ_CTL stop ++ rabbitmqctl_action stop + rc=$? + + if [ "$rc" != 0 ]; then diff --git a/rabbitmq-server.changes b/rabbitmq-server.changes index 80068e8..5bc0a1e 100644 --- a/rabbitmq-server.changes +++ b/rabbitmq-server.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Wed Apr 2 21:03:09 UTC 2014 - vuntz@suse.com + +- Add ocf-fixes.patch to fix issues in the OCF file: + - use the wrapper function to call rabbitmqctl for stop, so that + we interpret correctly the exit code. + - accept 1 as valid exit code from "rabbitmqctl status", instead + of totally breaking when we get it. +- We use a patch as the OCF file comes from upstream, so it's + better to keep the changes isolated. + ------------------------------------------------------------------- Thu Mar 27 11:20:12 UTC 2014 - dmueller@suse.com diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index 73667b8..35e69ed 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -41,6 +41,7 @@ Source6: rabbitmq-server.service Source7: rabbitmq-server.tmpfiles.d.conf Patch0: no-nmap.patch Patch1: no-remove-common.patch +Patch10: ocf-fixes.patch BuildRequires: erlang BuildRequires: erlang-src BuildRequires: fdupes @@ -102,6 +103,9 @@ This package includes the RabbitMQ AMQP language bindings for Erlang. %setup -q %patch0 %patch1 +%define _rabbit_server_ocf `basename %{SOURCE4}` +cp %{SOURCE4} %{_rabbit_server_ocf} +%patch10 -p1 %build make all VERSION=%{version} @@ -127,11 +131,9 @@ install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service # Install wrapper scripts %define _rabbit_wrapper %{_builddir}/`basename %{SOURCE2}` -%define _rabbit_server_ocf %{_builddir}/`basename %{SOURCE4}` cp %{SOURCE2} %{_rabbit_wrapper} sed -i 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' %{_rabbit_wrapper} sed -i 's|/usr/lib/|%{_libdir}/|' %{_rabbit_wrapper} -cp %{SOURCE4} %{_rabbit_server_ocf} install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmqctl install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-server install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-plugins