summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/ocf/ganesha_grace
diff options
context:
space:
mode:
authorKaleb S KEITHLEY <kkeithle@redhat.com>2016-04-06 12:00:52 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-04-28 03:20:02 -0700
commitf46206030afdd5337d857761e36936c13feee72d (patch)
tree8e38c21b44be4959c61ef1c276adc6ac05760bf7 /extras/ganesha/ocf/ganesha_grace
parent17ddeb5cfed4029db65d6432511ddff28c866129 (diff)
common-ha: continuous grace_mon log messages in /var/log/messages
messages are seen on RHEL6.x and RHEL7.1 and earlier versions of pacemaker. (And RHEL7.2 with RHEL7.1 pacemaker packages.) It's not possible to query attrd attributes in the older version, only set/update/clear them. The messages come from invalid attempts to query the attributes. However it is possible to query crm attributes. The fix here is to create a "shadow" crm attribute for the attrd attribute. Changes are made to both, queries are made on the crm attribute. (Resource Agents "follow" the attrd attribute using constraint locations, so we must keep the attrd attribute.) Backport of > Change-Id: I84ac1a80673e528d98b67b7d5062e21dcf744d4a > BUG: 1324509 > http://review.gluster.org/#/c/13919/ Change-Id: I7301c48849496be026ef598c588e78c68f273a8a BUG: 1324510 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/13920 Reviewed-by: Niels de Vos <ndevos@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com>
Diffstat (limited to 'extras/ganesha/ocf/ganesha_grace')
-rw-r--r--extras/ganesha/ocf/ganesha_grace28
1 files changed, 16 insertions, 12 deletions
diff --git a/extras/ganesha/ocf/ganesha_grace b/extras/ganesha/ocf/ganesha_grace
index a82c9af417a..7c629f5e773 100644
--- a/extras/ganesha/ocf/ganesha_grace
+++ b/extras/ganesha/ocf/ganesha_grace
@@ -30,17 +30,17 @@
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
if [ -n "$OCF_DEBUG_LIBRARY" ]; then
- . $OCF_DEBUG_LIBRARY
+ . $OCF_DEBUG_LIBRARY
else
- : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
-. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+ : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
+ . ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
fi
OCF_RESKEY_grace_active_default="grace-active"
: ${OCF_RESKEY_grace_active=${OCF_RESKEY_grace_active_default}}
ganesha_meta_data() {
- cat <<END
+ cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="ganesha_grace">
@@ -93,9 +93,11 @@ esac
ganesha_grace_start()
{
- rc=${OCF_ERR_GENERIC}
+ local rc=${OCF_ERR_GENERIC}
+ local short_host=$(hostname -s)
+
ocf_log debug "ganesha_grace_start()"
- attr=$(attrd_updater -Q -n ${OCF_RESKEY_grace_active})
+ attr=$(crm_attribute --query --node=${short_host} --name=${OCF_RESKEY_grace_active})
# Three possibilities:
# 1. There is no attribute at all and attr_updater returns
@@ -116,7 +118,7 @@ ganesha_grace_start()
fi
# case 2
- if [[ "${attr}" = *"value=\"1\"" ]]; then
+ if [[ "${attr}" = *"value=1" ]]; then
return ${OCF_SUCCESS}
fi
@@ -149,10 +151,12 @@ ganesha_grace_notify()
ganesha_grace_monitor()
{
- rc=${OCF_ERR_GENERIC}
+ local rc=${OCF_ERR_GENERIC}
+ local short_host=$(hostname -s)
+
ocf_log debug "monitor"
- attr=$(attrd_updater -Q -n ${OCF_RESKEY_grace_active})
+ attr=$(crm_attribute --query --node=${short_host} --name=${OCF_RESKEY_grace_active})
# if there is no attribute (yet), maybe it's because
# this RA started before ganesha_mon (nfs-mon) has had
@@ -162,7 +166,7 @@ ganesha_grace_monitor()
return ${OCF_SUCCESS}
fi
- if [[ "${attr}" = *"value=\"1\"" ]]; then
+ if [[ "${attr}" = *"value=1" ]]; then
rc=${OCF_SUCCESS}
fi
@@ -187,8 +191,8 @@ status|monitor) ganesha_grace_monitor
notify) ganesha_grace_notify
;;
*) ganesha_grace_usage
- exit ${OCF_ERR_UNIMPLEMENTED}
- ;;
+ exit ${OCF_ERR_UNIMPLEMENTED}
+ ;;
esac
rc=$?