From 1b8bcc53233a35273f28bc8ab70871ff7c0c08fe Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Tue, 16 Jun 2015 09:53:09 -0400 Subject: common-ha: cluster setup issues on RHEL7 * use --name on RHEL7 (later versions of pcs drop --name) we guessed wrong and did not get the version that dropped use of --name option * more robust config file param parsing for n/v with ""s in the value after not sourcing the config file * pid file fix. RHEL6 init.d adds -p /var/run/ganesha.nfsd.pid to cmdline options. RHEL7 systemd does not, so defaults to /var/run/ganesha.pid. Change-Id: I2236d41c8a87e4ead082274dddec19307d1f4db9 BUG: 1232333 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/11258 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: soumya k Reviewed-by: Meghana M --- extras/ganesha/ocf/ganesha_mon | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'extras/ganesha/ocf/ganesha_mon') diff --git a/extras/ganesha/ocf/ganesha_mon b/extras/ganesha/ocf/ganesha_mon index 47943f8a577..c8e7de9c45e 100644 --- a/extras/ganesha/ocf/ganesha_mon +++ b/extras/ganesha/ocf/ganesha_mon @@ -97,9 +97,17 @@ ganesha_mon_stop() ganesha_mon_monitor() { local short_host=$(hostname -s) + local pid_file="/var/run/ganesha.nfsd.pid" - if [ -e /var/run/ganesha.nfsd.pid -a \ - -d /proc/$(cat /var/run/ganesha.nfsd.pid) ]; then + # RHEL6 /etc/init.d/nfs-ganesha adds -p /var/run/ganesha.nfsd.pid + # RHEL7 systemd does not. Would be nice if all distros used the + # same pid file. + if [ -e /usr/lib/systemd/system/nfs-ganesha.service ]; then + pid_file="/var/run/ganesha.pid" + fi + + if [ -e ${pid_file} -a \ + -d /proc/$(cat ${pid_file} ) ]; then ( pcs resource delete ${short_host}-dead_ip-1 > /dev/null 2>&1 ) attrd_updater -n ganesha-active -v 1 -- cgit