diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2017-10-16 14:24:29 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-08-24 02:08:57 +0000 |
commit | 673f2f90f35e5ea381bd22a43403278f89c957a5 (patch) | |
tree | 297f645a4cc6dfbe48609b03da26a1e93607ab7d /extras/ganesha/scripts/dbus-send.sh | |
parent | 3fe34c921146a8d11875dc3d904e3a5994eb1cb6 (diff) |
Revert "glusterd: (storhaug) remove ganesha (843e1b0)"
please note as an additional change, macro GLUSTERD_GET_SNAP_DIR
moved from glusterd-store.c to glusterd-snapshot-utils.h
Change-Id: I811efefc148453fe32e4f0d322e80455447cec71
updates: #663
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'extras/ganesha/scripts/dbus-send.sh')
-rwxr-xr-x | extras/ganesha/scripts/dbus-send.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/extras/ganesha/scripts/dbus-send.sh b/extras/ganesha/scripts/dbus-send.sh index ec8d9485ad7..9d613a0e7ad 100755 --- a/extras/ganesha/scripts/dbus-send.sh +++ b/extras/ganesha/scripts/dbus-send.sh @@ -41,8 +41,18 @@ string:"EXPORT(Path=/$VOL)" #This function removes an export dynamically(uses the export_id of the export) function dynamic_export_remove() { - removed_id=`cat $GANESHA_DIR/exports/export.$VOL.conf |\ -grep Export_Id | awk -F"[=,;]" '{print$2}'| tr -d '[[:space:]]'` + # Below bash fetch all the export from ShowExport command and search + # export entry based on path and then get its export entry. + # There are two possiblities for path, either entire volume will be + # exported or subdir. It handles both cases. But it remove only first + # entry from the list based on assumption that entry exported via cli + # has lowest export id value + removed_id=$(dbus-send --type=method_call --print-reply --system \ + --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \ + org.ganesha.nfsd.exportmgr.ShowExports | grep -B 1 -we \ + "/"$VOL -e "/"$VOL"/" | grep uint16 | awk '{print $2}' \ + | head -1) + dbus-send --print-reply --system \ --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \ org.ganesha.nfsd.exportmgr.RemoveExport uint16:$removed_id |