summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2016-10-28 17:37:39 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-12-19 04:46:10 -0800
commit5de5060df16597a4e1f9981616816018db3fea19 (patch)
tree954a18a9e5080c6bc05a4c6b96e3e0512029f1ee
parent8c93cbb4ba307e47f61c5551023bd82842f184ff (diff)
ganesha/scripts : use export id for dbus signals
Currently for add export and update export parameter passed for executing those signal is "PATH". This is based on assumption that volume name and PATH will always be same. But it is wrong for subdir exports. The only reliable parameter in export configuration file is "Export_Id". Upstream reference : >Change-Id: Ic63ff44ac7736e14502034b74beaae27292eddf9 >BUG: 1389746 >Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> >Reviewed-on: http://review.gluster.org/15751 >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> Change-Id: Ic63ff44ac7736e14502034b74beaae27292eddf9 BUG: 1405918 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/15970 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> (cherry picked from commit beace6aed3ef27e1e55a420d606ecdfbd56b32b2) Reviewed-on: http://review.gluster.org/16194
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh6
-rwxr-xr-xextras/hook-scripts/start/post/S31ganesha-start.sh10
2 files changed, 6 insertions, 10 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index f43dbf4b296..f19e8877c69 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -261,7 +261,7 @@ ${tganesha_vol_conf}
while [[ ${3} ]]; do
current_host=`echo ${3} | cut -d "." -f 1`
if [ ${short_host} != ${current_host} ]; then
- removed_id=$(ssh -oPasswordAuthentication=no \
+ removed_id=$(ssh -oPasswordAuthentication=no \
-oStrictHostKeyChecking=no -i ${SECRET_PEM} root@${current_host} \
"cat $HA_CONFDIR/exports/export.$VOL.conf |\
grep Export_Id | awk -F\"[=,;]\" '{print \$2}' | tr -d '[[:space:]]'")
@@ -291,7 +291,7 @@ ${current_host}:${HA_CONFDIR}/exports/export.$VOL.conf
"dbus-send --print-reply --system --dest=org.ganesha.nfsd \
/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
string:$HA_CONFDIR/exports/export.$VOL.conf \
-string:\"EXPORT(Path=/$VOL)\" 2>&1")
+string:\"EXPORT(Path=/$removed_id)\" 2>&1")
ret=$?
logger <<< "${output}"
if [ ${ret} -ne 0 ]; then
@@ -325,7 +325,7 @@ uint16:$removed_id 2>&1)
output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \
/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
string:$HA_CONFDIR/exports/export.$VOL.conf \
-string:"EXPORT(Path=/$VOL)" 2>&1)
+string:"EXPORT(Path=/$removed_id)" 2>&1)
ret=$?
logger <<< "${output}"
if [ ${ret} -ne 0 ] ; then
diff --git a/extras/hook-scripts/start/post/S31ganesha-start.sh b/extras/hook-scripts/start/post/S31ganesha-start.sh
index b85c789b9ed..d0b5101f0ea 100755
--- a/extras/hook-scripts/start/post/S31ganesha-start.sh
+++ b/extras/hook-scripts/start/post/S31ganesha-start.sh
@@ -61,6 +61,7 @@ echo "}"
}
#This function keeps track of export IDs and increments it with every new entry
+#Also it adds the export dynamically by sending dbus signals
function export_add()
{
count=`ls -l $GANESHA_DIR/exports/*.conf | wc -l`
@@ -79,17 +80,13 @@ function export_add()
#fi
fi
echo $EXPORT_ID > $GANESHA_DIR/.export_added
- sed -i s/Export_Id.*/"Export_Id= $EXPORT_ID ;"/ \
+ sed -i s/Export_Id.*/"Export_Id=$EXPORT_ID;"/ \
$GANESHA_DIR/exports/export.$VOL.conf
echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF1
-}
-#This function adds a new export dynamically by sending dbus signals
-function dynamic_export_add()
-{
dbus-send --print-reply --system --dest=org.ganesha.nfsd \
/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
-string:$GANESHA_DIR/exports/export.$VOL.conf string:"EXPORT(Path=/$VOL)"
+string:$GANESHA_DIR/exports/export.$VOL.conf string:"EXPORT(Export_Id=$EXPORT_ID)"
}
@@ -99,7 +96,6 @@ function start_ganesha()
sed -i /$VOL.conf/d $CONF1
#Create a new export entry
export_add $VOL
- dynamic_export_add $VOL
}