|
|
581d9d |
From 74b3cff4fce5483d126b16131db53f8bd5804c82 Mon Sep 17 00:00:00 2001
|
|
|
581d9d |
From: Peter Lemenkov <lemenkov@redhat.com>
|
|
|
581d9d |
Date: Tue, 21 Jun 2016 15:48:07 +0200
|
|
|
581d9d |
Subject: [PATCH] Don't run scriptlets if Mnesia isn't available
|
|
|
581d9d |
|
|
|
581d9d |
See this rhbz for further details and symptoms:
|
|
|
581d9d |
|
|
|
581d9d |
https://bugzilla.redhat.com/1343905
|
|
|
581d9d |
|
|
|
581d9d |
Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>
|
|
|
581d9d |
---
|
|
|
581d9d |
heartbeat/rabbitmq-cluster | 5 +++++
|
|
|
581d9d |
1 file changed, 5 insertions(+)
|
|
|
581d9d |
|
|
|
581d9d |
diff --git a/heartbeat/rabbitmq-cluster b/heartbeat/rabbitmq-cluster
|
|
|
581d9d |
index facca35..18e3206 100755
|
|
|
581d9d |
--- a/heartbeat/rabbitmq-cluster
|
|
|
581d9d |
+++ b/heartbeat/rabbitmq-cluster
|
|
|
581d9d |
@@ -346,6 +346,8 @@ rmq_start() {
|
|
|
581d9d |
BaseDataDir=`dirname $RMQ_DATA_DIR`
|
|
|
581d9d |
if [ -f $BaseDataDir/users.erl ] ; then
|
|
|
581d9d |
rabbitmqctl eval "
|
|
|
581d9d |
+ %% Run only if Mnesia is ready, otherwise exit.
|
|
|
581d9d |
+ lists:any(fun({mnesia,_,_}) -> true; ({_,_,_}) -> false end, application:which_applications()) orelse halt(),
|
|
|
581d9d |
|
|
|
581d9d |
[WildPattern] = ets:select(mnesia_gvar, [ { {{rabbit_user, wild_pattern}, '\\\$1'}, [], ['\\\$1'] } ]),
|
|
|
581d9d |
|
|
|
581d9d |
@@ -391,6 +393,9 @@ rmq_stop() {
|
|
|
581d9d |
# Backup users
|
|
|
581d9d |
BaseDataDir=`dirname $RMQ_DATA_DIR`
|
|
|
581d9d |
rabbitmqctl eval "
|
|
|
581d9d |
+ %% Run only if Mnesia is still available, otherwise exit.
|
|
|
581d9d |
+ lists:any(fun({mnesia,_,_}) -> true; ({_,_,_}) -> false end, application:which_applications()) orelse halt(),
|
|
|
581d9d |
+
|
|
|
581d9d |
[WildPattern] = ets:select(mnesia_gvar, [ { {{rabbit_user, wild_pattern}, '\\\$1'}, [], ['\\\$1'] } ]),
|
|
|
581d9d |
|
|
|
581d9d |
Users = case WildPattern of
|