summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-06-16 09:53:09 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-19 02:19:54 -0700
commit1b8bcc53233a35273f28bc8ab70871ff7c0c08fe (patch)
tree6fe827578ea399ff776faf1be619049f95a46624 /extras/ganesha/scripts
parent92bf6fcdfbaad7f20efa86eec34cd9e14233c6de (diff)
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 <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/11258 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Meghana M <mmadhusu@redhat.com>
Diffstat (limited to 'extras/ganesha/scripts')
-rwxr-xr-xextras/ganesha/scripts/ganesha-ha.sh23
1 files changed, 14 insertions, 9 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index fc2a00980c1..725b6b450e3 100755
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -26,7 +26,9 @@ HA_CONFDIR=""
HA_VOL_NAME="gluster_shared_storage"
HA_VOL_MNT="/var/run/gluster/shared_storage"
SERVICE_MAN="DISTRO_NOT_FOUND"
-CONF=$(cat /etc/sysconfig/ganesha | grep "CONFFILE" | cut -f 2 -d "=")
+cfgline=$(grep ^CONFFILE= /etc/sysconfig/ganesha)
+eval $(echo ${cfgline} | grep -F CONFFILE=)
+GANESHA_CONF=${CONFFILE:-/etc/ganesha/ganesha.conf}
RHEL6_PCS_CNAME_OPTION="--name"
@@ -236,7 +238,7 @@ cleanup_ganesha_config ()
rm -rf ${HA_CONFDIR}/.export_added
rm -rf /etc/cluster/cluster.conf*
rm -rf /var/lib/pacemaker/cib/*
- sed -r -i -e '/^%include[[:space:]]+".+\.conf"$/d' $CONF
+ sed -r -i -e '/^%include[[:space:]]+".+\.conf"$/d' ${GANESHA_CONF}
}
do_create_virt_ip_constraints()
@@ -740,15 +742,18 @@ main()
local node=""
local vip=""
- ha_name=$(grep ^HA_NAME= ${ha_conf} | cut -d = -f 2)
- HA_NAME=${ha_name//\"/}
- ha_vol_server=$(grep ^HA_VOL_SERVER= ${ha_conf} | cut -d = -f 2)
- HA_VOL_SERVER=${ha_vol_server//\"/}
- ha_cluster_nodes=$(grep ^HA_CLUSTER_NODES= ${ha_conf} | cut -d = -f 2)
- HA_CLUSTER_NODES=${ha_cluster_nodes//\"/}
+ # ignore any comment lines
+ cfgline=$(grep ^HA_NAME= ${ha_conf})
+ eval $(echo ${cfgline} | grep -F HA_NAME=)
+ cfgline=$(grep ^HA_VOL_SERVER= ${ha_conf})
+ eval $(echo ${cfgline} | grep -F HA_VOL_SERVER=)
+ cfgline=$(grep ^HA_CLUSTER_NODES= ${ha_conf})
+ eval $(echo ${cfgline} | grep -F HA_CLUSTER_NODES=)
+ # we'll pretend that nobody ever edits /etc/os-release
if [ -e /etc/os-release ]; then
- RHEL6_PCS_CNAME_OPTION=""
+ eval $(grep -F "REDHAT_SUPPORT_PRODUCT=" /etc/os-release)
+ [ "$REDHAT_SUPPORT_PRODUCT" == "Fedora" ] && RHEL6_PCS_CNAME_OPTION=""
fi
case "${cmd}" in