From d513f41ef8089a9df2fe1240dd9f1952b9a41767 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Wed, 23 Nov 2016 16:04:26 +0530 Subject: glusterd/ganesha : handle volume reset properly for ganesha options The "gluster volume reset" should first unexport the volume and then delete export configuration file. Also reset option is not applicable for ganesha.enable if volume value is "all". This patch also changes the name of create_export_config into manange_export_config Upstream reference : >Change-Id: Ie81a49e7d3e39a88bca9fbae5002bfda5cab34af >BUG: 1397795 >Signed-off-by: Jiffin Tony Thottan >Reviewed-on: http://review.gluster.org/15914 >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: soumya k >Reviewed-by: Kaleb KEITHLEY >Signed-off-by: Jiffin Tony Thottan Change-Id: Ie81a49e7d3e39a88bca9fbae5002bfda5cab34af BUG: 1405951 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/16054 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kaleb KEITHLEY Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/16197 --- extras/hook-scripts/reset/post/Makefile.am | 5 +-- extras/hook-scripts/reset/post/S31ganesha-reset.sh | 48 ---------------------- 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100755 extras/hook-scripts/reset/post/S31ganesha-reset.sh (limited to 'extras/hook-scripts') diff --git a/extras/hook-scripts/reset/post/Makefile.am b/extras/hook-scripts/reset/post/Makefile.am index bb28d990596..1b336ac1a85 100644 --- a/extras/hook-scripts/reset/post/Makefile.am +++ b/extras/hook-scripts/reset/post/Makefile.am @@ -1,4 +1 @@ -EXTRA_DIST = S31ganesha-reset.sh - -hookdir = $(GLUSTERD_WORKDIR)/hooks/1/reset/post/ -hook_SCRIPTS = S31ganesha-reset.sh +EXTRA_DIST = diff --git a/extras/hook-scripts/reset/post/S31ganesha-reset.sh b/extras/hook-scripts/reset/post/S31ganesha-reset.sh deleted file mode 100755 index 9538911a842..00000000000 --- a/extras/hook-scripts/reset/post/S31ganesha-reset.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -PROGNAME="Sganesha-reset" -OPTSPEC="volname:,gd-workdir:" -VOL= -GLUSTERD_WORKDIR= - -function parse_args () { - ARGS=$(getopt -l $OPTSPEC -o "o" -name $PROGNAME $@) - eval set -- "$ARGS" - while true; do - case $1 in - --volname) - shift - VOL=$1 - ;; - --gd-workdir) - shift - GLUSTERD_WORKDIR=$1 - ;; - *) - shift - break - ;; - esac - shift - done -} - -function is_volume_started () { - volname=$1 - echo "$(grep status $GLUSTERD_WORKDIR/vols/"$volname"/info |\ - cut -d"=" -f2)" -} - -parse_args $@ -if ps aux | grep -q "[g]anesha.nfsd" - then - kill -s TERM `cat /var/run/ganesha.pid` - sleep 10 - rm -rf /var/lib/glusterfs-ganesha/exports - rm -rf /var/lib/glusterfs-ganesha/.export_added - sed -i /conf/d /var/lib/ganesha/nfs-ganesha.conf - if [ "1" = $(is_volume_started "$VOL") ]; - then - gluster volume start $VOL force - fi -fi -- cgit