summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2016-11-23 16:04:26 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-12-23 04:11:52 -0800
commitd513f41ef8089a9df2fe1240dd9f1952b9a41767 (patch)
treee347a374bb60056ec0c6b7ed6e8a75f58c799a9a
parentb869735cef1e77f3225e2fcdf9a81221a76ae768 (diff)
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 <jthottan@redhat.com> >Reviewed-on: http://review.gluster.org/15914 >Smoke: Gluster Build System <jenkins@build.gluster.org> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: soumya k <skoduri@redhat.com> >Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> >Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Change-Id: Ie81a49e7d3e39a88bca9fbae5002bfda5cab34af BUG: 1405951 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/16054 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/16197
-rw-r--r--extras/hook-scripts/reset/post/Makefile.am5
-rwxr-xr-xextras/hook-scripts/reset/post/S31ganesha-reset.sh48
-rw-r--r--glusterfs.spec.in4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c16
4 files changed, 4 insertions, 69 deletions
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
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 3a2586682f9..b28bb426555 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -1003,7 +1003,6 @@ exit 0
%{_libexecdir}/ganesha/*
%{_prefix}/lib/ocf/resource.d/heartbeat/*
%{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
-%{_sharedstatedir}/glusterd/hooks/1/reset/post/S31ganesha-reset.sh
%if ( 0%{!?_without_georeplication:1} )
%files geo-replication
@@ -1185,6 +1184,9 @@ exit 0
%endif
%changelog
+* Thu Dec 19 2016 Jiffin Tony Thottan <jhottan@redhat.com>
+- remove S31ganesha-reset.sh from hooks (#1405951)
+
* Mon Aug 22 2016 Milind Changire <mchangir@redhat.com>
- Add psmisc as dependency for glusterfs-fuse for killall command (#1367665)
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 4ad23359efd..20b51edee3c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -2036,7 +2036,6 @@ glusterd_op_reset_all_volume_options (xlator_t *this, dict_t *dict)
gf_boolean_t all = _gf_false;
char *next_version = NULL;
gf_boolean_t quorum_action = _gf_false;
- gf_boolean_t option = _gf_false;
char *op_errstr = NULL;
conf = this->private;
@@ -2066,21 +2065,6 @@ glusterd_op_reset_all_volume_options (xlator_t *this, dict_t *dict)
if (key_fixed)
key = key_fixed;
- option = dict_get_str_boolean (conf->opts, GLUSTERD_STORE_KEY_GANESHA_GLOBAL,
- _gf_false);
- if (option) {
- ret = tear_down_cluster();
- if (ret == -1)
- gf_msg (THIS->name, GF_LOG_WARNING, errno,
- GD_MSG_DICT_GET_FAILED,
- "Could not tear down NFS-Ganesha cluster");
- ret = stop_ganesha (&op_errstr);
- if (ret)
- gf_msg (THIS->name, GF_LOG_WARNING, 0,
- GD_MSG_NFS_GNS_STOP_FAIL,
- "Could not stop NFS-Ganesha service");
- }
-
ret = -1;
dup_opt = dict_new ();
if (!dup_opt)