|
|
cb8e9e |
From c8d348dd59e729b8f59bd87149aa52cc16159279 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Meghana M <mmadhusu@redhat.com>
|
|
|
cb8e9e |
Date: Tue, 30 Jun 2015 23:47:39 +0530
|
|
|
cb8e9e |
Subject: [PATCH 199/200] NFS-Ganesha : Unexport fails after S31ganesha-start script is run
|
|
|
cb8e9e |
|
|
|
cb8e9e |
The dbus-send script extracts the export ID from the export config file.
|
|
|
cb8e9e |
It expects the export ID to be written in a particular format. The post-phase
|
|
|
cb8e9e |
hook-script created the export file in a different format,and the dbus-send
|
|
|
cb8e9e |
never gets the correct export ID because of this.
|
|
|
cb8e9e |
Fixing the issue by replacing the write_conf function in the
|
|
|
cb8e9e |
S31ganesha-start hook-script.Also, NFS-Ganesha service stops when dbus signal is sent more
|
|
|
cb8e9e |
than once on the same export. Consecutive start/stop operations creates problems.
|
|
|
cb8e9e |
Fixing all the issues at once.
|
|
|
cb8e9e |
|
|
|
cb8e9e |
This is a backport of the fix upstream,
|
|
|
cb8e9e |
http://review.gluster.org/#/c/11477/
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I3a80a8454f781896e85b8be7d9c3d979968afcf6
|
|
|
cb8e9e |
BUG: 1237053
|
|
|
cb8e9e |
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/52233
|
|
|
cb8e9e |
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
|
|
cb8e9e |
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
|
|
cb8e9e |
Tested-by: Kaleb Keithley <kkeithle@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
extras/ganesha/scripts/create-export-ganesha.sh | 3 +-
|
|
|
cb8e9e |
extras/hook-scripts/start/post/S31ganesha-start.sh | 46 +++++++++++--------
|
|
|
cb8e9e |
2 files changed, 28 insertions(+), 21 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/extras/ganesha/scripts/create-export-ganesha.sh b/extras/ganesha/scripts/create-export-ganesha.sh
|
|
|
cb8e9e |
index 9762c0d..668f357 100755
|
|
|
cb8e9e |
--- a/extras/ganesha/scripts/create-export-ganesha.sh
|
|
|
cb8e9e |
+++ b/extras/ganesha/scripts/create-export-ganesha.sh
|
|
|
cb8e9e |
@@ -32,8 +32,7 @@ function write_conf()
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
echo -e "# WARNING : Using Gluster CLI will overwrite manual
|
|
|
cb8e9e |
# changes made to this file. To avoid it, edit the
|
|
|
cb8e9e |
-# file, copy it over to all the NFS-Ganesha nodes
|
|
|
cb8e9e |
-# and run ganesha-ha.sh --refresh-config."
|
|
|
cb8e9e |
+# file and run ganesha-ha.sh --refresh-config."
|
|
|
cb8e9e |
|
|
|
cb8e9e |
echo "EXPORT{"
|
|
|
cb8e9e |
echo " Export_Id = 2;"
|
|
|
cb8e9e |
diff --git a/extras/hook-scripts/start/post/S31ganesha-start.sh b/extras/hook-scripts/start/post/S31ganesha-start.sh
|
|
|
cb8e9e |
index f1ca72b..a657b00 100755
|
|
|
cb8e9e |
--- a/extras/hook-scripts/start/post/S31ganesha-start.sh
|
|
|
cb8e9e |
+++ b/extras/hook-scripts/start/post/S31ganesha-start.sh
|
|
|
cb8e9e |
@@ -37,24 +37,27 @@ function parse_args ()
|
|
|
cb8e9e |
#This function generates a new export entry as export.volume_name.conf
|
|
|
cb8e9e |
function write_conf()
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- echo "EXPORT{
|
|
|
cb8e9e |
- "
|
|
|
cb8e9e |
- echo "Export_Id = ;"
|
|
|
cb8e9e |
- echo "Path=\"/$1\";"
|
|
|
cb8e9e |
- echo "FSAL {
|
|
|
cb8e9e |
- "
|
|
|
cb8e9e |
- echo "name = "GLUSTER";"
|
|
|
cb8e9e |
- echo "hostname="localhost";"
|
|
|
cb8e9e |
- echo "volume=\"$1\";"
|
|
|
cb8e9e |
- echo "}"
|
|
|
cb8e9e |
- echo "Access_type = RW;"
|
|
|
cb8e9e |
- echo "Squash = No_root_squash;"
|
|
|
cb8e9e |
- echo "Disable_ACL = TRUE;"
|
|
|
cb8e9e |
- echo "Pseudo=\"/$1\";"
|
|
|
cb8e9e |
- echo "Protocols = \"3\",\"4\" ;"
|
|
|
cb8e9e |
- echo "Transports = \"UDP\",\"TCP\" ;"
|
|
|
cb8e9e |
- echo "SecType = \"sys\";"
|
|
|
cb8e9e |
- echo "}"
|
|
|
cb8e9e |
+echo -e "# WARNING : Using Gluster CLI will overwrite manual
|
|
|
cb8e9e |
+# changes made to this file. To avoid it, edit the
|
|
|
cb8e9e |
+# file, copy it over to all the NFS-Ganesha nodes
|
|
|
cb8e9e |
+# and run ganesha-ha.sh --refresh-config."
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+echo "EXPORT{"
|
|
|
cb8e9e |
+echo " Export_Id = 2;"
|
|
|
cb8e9e |
+echo " Path = \"/$VOL\";"
|
|
|
cb8e9e |
+echo " FSAL {"
|
|
|
cb8e9e |
+echo " name = \"GLUSTER\";"
|
|
|
cb8e9e |
+echo " hostname=\"localhost\";"
|
|
|
cb8e9e |
+echo " volume=\"$VOL\";"
|
|
|
cb8e9e |
+echo " }"
|
|
|
cb8e9e |
+echo " Access_type = RW;"
|
|
|
cb8e9e |
+echo " Disable_ACL = true;"
|
|
|
cb8e9e |
+echo " Squash=\"No_root_squash\";"
|
|
|
cb8e9e |
+echo " Pseudo=\"/$VOL\";"
|
|
|
cb8e9e |
+echo " Protocols = \"3\", \"4\" ;"
|
|
|
cb8e9e |
+echo " Transports = \"UDP\",\"TCP\";"
|
|
|
cb8e9e |
+echo " SecType = \"sys\";"
|
|
|
cb8e9e |
+echo "}"
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#This function keeps track of export IDs and increments it with every new entry
|
|
|
cb8e9e |
@@ -101,9 +104,14 @@ function start_ganesha()
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
parse_args $@
|
|
|
cb8e9e |
+ is_exported="no"
|
|
|
cb8e9e |
+ if showmount -e localhost | cut -d "" -f1 | grep -q "/$VOL[[:space:]]"
|
|
|
cb8e9e |
+ then
|
|
|
cb8e9e |
+ is_exported="yes"
|
|
|
cb8e9e |
+ fi
|
|
|
cb8e9e |
ganesha_value=$(grep $ganesha_key $GLUSTERD_WORKDIR/vols/$VOL/info |\
|
|
|
cb8e9e |
cut -d"=" -f2)
|
|
|
cb8e9e |
- if [ "$ganesha_value" = "on" ]
|
|
|
cb8e9e |
+ if [ "$ganesha_value" = "on" -a "$is_exported" = "no" ]
|
|
|
cb8e9e |
then
|
|
|
cb8e9e |
write_conf $VOL > $GANESHA_DIR/exports/export.$VOL.conf
|
|
|
cb8e9e |
start_ganesha $VOL
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|