Start RabbitMQ app on notify

On notify, if we detect that we are a part of a cluster we still
need to start the RabbitMQ application, because it is always
down after action_start finishes.

Closes-Bug: #1496386
Change-Id: I307452b687a6100cc4489c8decebbc3dccdbc432
(cherry picked from commit c1900b49e6)
This commit is contained in:
Dmitry Mescheryakov 2015-09-18 15:05:03 +03:00 committed by Sergii Rizvan
parent 09eb9e36bd
commit bb5340e01f
1 changed files with 11 additions and 2 deletions

View File

@ -424,7 +424,8 @@ get_nodes__base(){
then
infotype='running_db_nodes'
fi
local c_status=$(${OCF_RESKEY_ctl} eval "mnesia:system_info(${infotype})." 2>/dev/null)
local c_status
c_status=$(${OCF_RESKEY_ctl} eval "mnesia:system_info(${infotype})." 2>/dev/null)
rc=$?
if [[ $rc != 0 ]] ; then
echo ''
@ -1463,6 +1464,10 @@ action_notify() {
return $OCF_SUCCESS
fi
if [[ $rc == $OCF_SUCCESS ]] ; then
# Now we need to:
# a. join to the cluster if we are not joined yet
# b. start the RabbitMQ application, which is always
# stopped after start action finishes
check_need_join_to ${OCF_RESKEY_CRM_meta_notify_master_uname}
rc_join=$?
if [[ ${rc_join} == $OCF_SUCCESS ]]; then
@ -1471,7 +1476,11 @@ action_notify() {
rc2=$?
else
ocf_log warn "${LH} We are already clustered with node ${OCF_RESKEY_CRM_meta_notify_master_uname}"
rc2=$OCF_SUCCESS
if try_to_start_rmq_app; then
rc2=$OCF_SUCCESS
else
rc2=$OCF_ERR_GENERIC
fi
fi
ocf_log info "${LH} post-start end."
if [[ $rc2 == $OCF_ERR_GENERIC ]] ; then