diff options
Diffstat (limited to 'extras/ganesha/ocf/ganesha_mon')
-rw-r--r-- | extras/ganesha/ocf/ganesha_mon | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/extras/ganesha/ocf/ganesha_mon b/extras/ganesha/ocf/ganesha_mon index 974eb86a07a..7d0eb6b9cb8 100644 --- a/extras/ganesha/ocf/ganesha_mon +++ b/extras/ganesha/ocf/ganesha_mon @@ -124,8 +124,7 @@ ganesha_mon_stop() ganesha_mon_monitor() { - local short_host=$(hostname -s) - local long_host=$(hostname) + local host=$(hostname -s) local pid_file="/var/run/ganesha.nfsd.pid" # RHEL6 /etc/init.d/nfs-ganesha adds -p /var/run/ganesha.nfsd.pid @@ -154,13 +153,15 @@ ganesha_mon_monitor() # track grace-active crm_attr (attr != crm_attr) # we can't just use the attr as there's no way to query # its value in RHEL6 pacemaker - crm_attribute --node=${short_host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 2> /dev/null - if [ $? -ne 0 ]; then - crm_attribute --node=${long_host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 2> /dev/null - if [ $? -ne 0 ]; then - ocf_log info "warning: crm_attribute --node=${short_host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 failed" - fi - fi + + crm_attribute --node=${host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 2> /dev/null + if [ $? -ne 0 ]; then + host=$(hostname) + crm_attribute --node=${host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 2> /dev/null + if [ $? -ne 0 ]; then + ocf_log info "mon monitor warning: crm_attribute --node=${host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 failed" + fi + fi return ${OCF_SUCCESS} fi @@ -182,13 +183,15 @@ ganesha_mon_monitor() ocf_log info "warning: attrd_updater -D -n ${OCF_RESKEY_grace_active} failed" fi - crm_attribute --node=${short_host} --name=${OCF_RESKEY_grace_active} --update=0 2> /dev/null + host=$(hostname -s) + crm_attribute --node=${host} --name=${OCF_RESKEY_grace_active} --update=0 2> /dev/null if [ $? -ne 0 ]; then - crm_attribute --node=${long_host} --name=${OCF_RESKEY_grace_active} --update=0 2> /dev/null - if [ $? -ne 0 ]; then - ocf_log info "warning: crm_attribute --node=${short_host} --name=${OCF_RESKEY_grace_active} --update=0 failed" - fi - fi + host=$(hostname) + crm_attribute --node=${host} --name=${OCF_RESKEY_grace_active} --update=0 2> /dev/null + if [ $? -ne 0 ]; then + ocf_log info "mon monitor warning: crm_attribute --node=${host} --name=${OCF_RESKEY_grace_active} --update=0 failed" + fi + fi sleep ${OCF_RESKEY_grace_delay} |