summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2016-07-12 17:23:03 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-08-26 04:46:06 -0700
commita769be2c0d4227fead7348e769bd1ae49e267971 (patch)
treed4bc04f2a312eab2ecb9a0e1f6d271f606bd9048 /extras
parentca2c94bfcf96c44abb7168a9cb9c99a40e566280 (diff)
Revert "glusterd-ganesha : copy ganesha export configuration files during reboot"
This reverts commit f71e2fa49af185779b9f43e146effd122d4e9da0. Reason: As part of sync up node reboot this patch copies ganesha export conf file from a source node. This change is no more require if the export files are available in shared storage. Change-Id: Id9c1ae78377bbd7d5d80aa1c14f534e30feaae97 BUG: 1355956 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/14907 Reviewed-by: soumya k <skoduri@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> 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>
Diffstat (limited to 'extras')
-rw-r--r--extras/ganesha/scripts/Makefile.am4
-rwxr-xr-xextras/ganesha/scripts/copy-export-ganesha.sh97
2 files changed, 2 insertions, 99 deletions
diff --git a/extras/ganesha/scripts/Makefile.am b/extras/ganesha/scripts/Makefile.am
index c326fc2f136..224ed26e75b 100644
--- a/extras/ganesha/scripts/Makefile.am
+++ b/extras/ganesha/scripts/Makefile.am
@@ -1,6 +1,6 @@
EXTRA_DIST= ganesha-ha.sh dbus-send.sh create-export-ganesha.sh \
- generate-epoch.py copy-export-ganesha.sh
+ generate-epoch.py
scriptsdir = $(libexecdir)/ganesha
scripts_SCRIPTS = create-export-ganesha.sh dbus-send.sh ganesha-ha.sh \
- generate-epoch.py copy-export-ganesha.sh
+ generate-epoch.py
diff --git a/extras/ganesha/scripts/copy-export-ganesha.sh b/extras/ganesha/scripts/copy-export-ganesha.sh
deleted file mode 100755
index 9c4afa02d68..00000000000
--- a/extras/ganesha/scripts/copy-export-ganesha.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-
-#This script is called by glusterd when in case of
-#reboot.An export file specific to a volume
-#is copied in GANESHA_DIR/exports from online node.
-
-# Try loading the config from any of the distro
-# specific configuration locations
-if [ -f /etc/sysconfig/ganesha ]
- then
- . /etc/sysconfig/ganesha
-fi
-if [ -f /etc/conf.d/ganesha ]
- then
- . /etc/conf.d/ganesha
-fi
-if [ -f /etc/default/ganesha ]
- then
- . /etc/default/ganesha
-fi
-
-GANESHA_DIR=${1%/}
-VOL=$2
-CONF=
-host=$(hostname -s)
-SECRET_PEM="/var/lib/glusterd/nfs/secret.pem"
-
-function check_cmd_status()
-{
- if [ "$1" != "0" ]
- then
- rm -rf $GANESHA_DIR/exports/export.$VOL.conf
- exit 1
- fi
-}
-
-
-if [ ! -d "$GANESHA_DIR/exports" ];
- then
- mkdir $GANESHA_DIR/exports
- check_cmd_status `echo $?`
-fi
-
-function find_rhel7_conf
-{
- while [[ $# > 0 ]]
- do
- key="$1"
- case $key in
- -f)
- CONFFILE="$2"
- ;;
- *)
- ;;
- esac
- shift
- done
-}
-
-if [ -z $CONFFILE ]; then
- find_rhel7_conf $OPTIONS
-
-fi
-CONF=${CONFFILE:-/etc/ganesha/ganesha.conf}
-
-#remove the old export entry from NFS-Ganesha
-#if already exported
-dbus-send --type=method_call --print-reply --system \
- --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
- org.ganesha.nfsd.exportmgr.ShowExports \
- | grep -w -q "/$VOL"
-if [ $? -eq 0 ]; then
- removed_id=`cat $GANESHA_DIR/exports/export.$VOL.conf |\
- grep Export_Id | awk -F"[=,;]" '{print$2}' | tr -d '[[:space:]]'`
-
- dbus-send --print-reply --system --dest=org.ganesha.nfsd \
- /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport \
- uint16:$removed_id 2>&1
-fi
-
-ha_servers=$(pcs status | grep "Online:" | grep -o '\[.*\]' | sed -e 's/\[//' | sed -e 's/\]//')
-IFS=$' '
-for server in ${ha_servers} ; do
- current_host=`echo $server | cut -d "." -f 1`
- if [ $host != $current_host ]
- then
- scp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
- ${SECRET_PEM} $server:$GANESHA_DIR/exports/export.$VOL.conf \
- $GANESHA_DIR/exports/export.$VOL.conf
- break
- fi
-done
-
-if ! (cat $CONF | grep $VOL.conf\"$ )
-then
-echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF
-fi