summaryrefslogtreecommitdiff
path: root/scripts/rabbitmq-server-ha.ocf
diff options
context:
space:
mode:
authorDmitry Mescheryakov <dmescheryakov@mirantis.com>2016-02-25 17:45:32 +0300
committerDmitry Mescheryakov <dmescheryakov@mirantis.com>2016-02-25 17:45:32 +0300
commit3fa7e7b05c4a921f5baecb27bee57615b96acb3d (patch)
tree3b9a8a7b97785f7e0932f5bedddbd4f4353d74ca /scripts/rabbitmq-server-ha.ocf
parenta578f1228b5e0e7ca276ce74738fc446beece07e (diff)
downloadrabbitmq-server-git-3fa7e7b05c4a921f5baecb27bee57615b96acb3d.tar.gz
[OCF HA] Log process id in RabbitMQ OCF script
Several OCF calls might run simultaneously. For example, it often happens that two monitor calls intersect. Logging current process id for each line helps distinguish logs of different calls. Also aligned get_status() logging with format used in all other parts of the script.
Diffstat (limited to 'scripts/rabbitmq-server-ha.ocf')
-rwxr-xr-xscripts/rabbitmq-server-ha.ocf9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
index b5ba1db518..655798a9a1 100755
--- a/scripts/rabbitmq-server-ha.ocf
+++ b/scripts/rabbitmq-server-ha.ocf
@@ -613,7 +613,7 @@ rmq_setup_env() {
fi
done
- export LL="${OCF_RESOURCE_INSTANCE}:"
+ export LL="${OCF_RESOURCE_INSTANCE}[$$]:"
update_cookie
}
@@ -1262,6 +1262,7 @@ start_rmq_server_app() {
get_status() {
local what="${1:-kernel}"
local rc=$OCF_NOT_RUNNING
+ local LH="${LL} get_status():"
local body
local beam_running
@@ -1272,11 +1273,11 @@ get_status() {
beam_running=$?
# report not running only if the which_applications() reported an error AND the beam is not running
if [ $rc -ne 0 -a $beam_running -ne 0 ] ; then
- ocf_log info "get_status() failed with code ${rc}. Command output: ${body}"
+ ocf_log info "${LH} failed with code ${rc}. Command output: ${body}"
return $OCF_NOT_RUNNING
# return a generic error, if there were errors and beam is found running
elif [ $rc -ne 0 ] ; then
- ocf_log info "get_status() found the beam process running but failed with code ${rc}. Command output: ${body}"
+ ocf_log info "${LH} found the beam process running but failed with code ${rc}. Command output: ${body}"
return $OCF_ERR_GENERIC
fi
@@ -1286,7 +1287,7 @@ get_status() {
echo "$body" | grep "\{${what}," 2>&1 > /dev/null && rc=$OCF_SUCCESS
if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "get_status(): app ${what} was not found in command output: ${body}"
+ ocf_log info "${LH} app ${what} was not found in command output: ${body}"
fi
fi