summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts/create-export-ganesha.sh
diff options
context:
space:
mode:
authorMeghana M <mmadhusu@redhat.com>2015-07-09 03:34:07 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-07-10 03:03:59 -0700
commit87bce01f323621c106a7fde221ea406abede41fc (patch)
tree791ef9db59ece3166c4fa5d1636dedc8d62dd687 /extras/ganesha/scripts/create-export-ganesha.sh
parentbcd89d50866080ebd5e4a1af4c3fe64832910f36 (diff)
NFS-Ganesha : Export fails on RHEL 7.1
We grep for CONFFILE parameter in "/etc/syconfig/ganesha" file to find out the path of the ganesha config file. In RHEL 7.1, this parameter does not exist in the file and we can't find out the ganesha config file. Export fails invariably due to this. Changing this pattern to a more generic one and default it to "/etc/ganesha/ganesha.conf" Change-Id: I4ac97b1b5ee4f5a7e448a351b7c6270385dffe61 BUG: 1241480 Signed-off-by: Meghana M <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/11594 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras/ganesha/scripts/create-export-ganesha.sh')
-rwxr-xr-xextras/ganesha/scripts/create-export-ganesha.sh32
1 files changed, 29 insertions, 3 deletions
diff --git a/extras/ganesha/scripts/create-export-ganesha.sh b/extras/ganesha/scripts/create-export-ganesha.sh
index 668f357409b..ab7c282af79 100755
--- a/extras/ganesha/scripts/create-export-ganesha.sh
+++ b/extras/ganesha/scripts/create-export-ganesha.sh
@@ -5,8 +5,10 @@
#An export file specific to a volume
#is created in GANESHA_DIR/exports.
-GANESHA_DIR=$1
+GANESHA_DIR=${1%/}
VOL=$2
+CONF=
+CONFFILE=
function check_cmd_status()
{
@@ -24,9 +26,33 @@ if [ ! -d "$GANESHA_DIR/exports" ];
check_cmd_status `echo $?`
fi
-CONF=$(cat /etc/sysconfig/ganesha | grep "CONFFILE" | cut -f 2 -d "=")
-check_cmd_status `echo $?`
+function find_rhel7_conf
+{
+ while [[ $# > 0 ]]
+ do
+ key="$1"
+ case $key in
+ -f)
+ CONFFILE="$2"
+ ;;
+ *)
+ ;;
+ esac
+ shift
+ done
+}
+
+cfgline=$(grep ^CONFFILE= /etc/sysconfig/ganesha)
+eval $(echo ${cfgline} | grep -F ^CONFFILE=)
+if [ -z $CONFFILE ]
+ then
+ cfgline=$(grep ^OPTIONS= /etc/sysconfig/ganesha)
+ eval $(echo ${cfgline} | grep -F ^OPTIONS=)
+ find_rhel7_conf $cfgline
+
+fi
+CONF=${CONFFILE:-/etc/ganesha/ganesha.conf}
function write_conf()
{