From 34f764638b63ee2d4eca46107b2ab1730ce2f2a8 Mon Sep 17 00:00:00 2001 From: Mohammed Azhar Padariyakam Date: Mon, 27 Nov 2017 15:35:08 +0530 Subject: [PATCH] Checking EXPORT Block Parameters at Client End Signed-off-by: Mohammed Azhar Padariyakam --- export_params/client.sh | 223 ++++++++++++++++++++++++++++++++ export_params/duffy.py | 148 ++++++++++++++++++++++ export_params/server.sh | 274 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 645 insertions(+) create mode 100644 export_params/client.sh create mode 100644 export_params/duffy.py create mode 100644 export_params/server.sh diff --git a/export_params/client.sh b/export_params/client.sh new file mode 100644 index 00000000..b8b098e9 --- /dev/null +++ b/export_params/client.sh @@ -0,0 +1,223 @@ +#!/bin/sh +# +# Environment variables used: +# - SERVER: hostname or IP-address of the NFS-server +# - EXPORT: NFS-export to test (should start with "/") + +# enable some more output +set -x + +[ -n "${SERVER}" ] +[ -n "${EXPORT}" ] + +if [ "$1" = "client_initialization" ] +then + # install build and runtime dependencies + yum -y install nfs-utils time + + mkdir -p /mnt/ganesha + + mount -t nfs -o vers=3 ${SERVER}:${EXPORT} /mnt/ganesha + + echo "Client Initial Stage --- With All Rights To All Clients ( RO & RW ) " + + cd /mnt/ganesha + + echo "Trying To Write A File" + echo "Hello World" > testFile.txt + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS ON WRITING RIGHTS" + else + echo "FAILED ON WRITING RIGHTS" + exit ret + fi + + echo "Trying To Read A File" + cat testFile.txt + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS" + else + echo "FAILED ON READING RIGHTS" + exit ret + fi + + echo "Trying To Change File Ownership For Checking ROOT Rights" + sudo chown root testFile.txt + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS" + else + echo "FAILED ON ROOT RIGHTS" + exit ret + fi + + cd / && umount /mnt/ganesha +fi + +if [ "$1" = "client_stage1" ] +then + echo "Client Stage 1 --- With Only RO Rights To Clients " + + mount -t nfs ${SERVER}:${EXPORT} /mnt/ganesha + + cd /mnt/ganesha + + echo "Trying To Write A File" + sed -i '1s/$/ From RedHat/' testFile.txt + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since Write Permissions Were Not Blocked To The Client" + exit ret + else + echo "SUCCESS ON WRITE PERMISSIONS FAILURE" + fi + + echo "Trying To Read A File" + cat testFile.txt + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS" + else + echo "FAILED ON READING RIGHTS" + exit ret + fi + + cd / && umount /mnt/ganesha +fi + + +if [ "$1" = "client_stage2" ] +then + echo "Client Stage 2 --- With Only Rights For v3 Mount To Clients " + + echo "Trying To Mount By vers=3" + mount -t nfs -o vers=3 ${SERVER}:${EXPORT} /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS ON v3 MOUNT BY CLIENT" + else + echo "FAILURE ON v3 MOUNT BY CLIENT" + exit ret + fi + + cd / && umount /mnt/ganesha + + echo "Trying To Mount By vers=4.0" + mount -t nfs -o vers=4.0 ${SERVER}:${EXPORT} /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since v4.0 Permissions Were Not Given To The Client" + exit ret + else + echo "SUCCESS ON v4.0 MOUNT FAILURE" + fi + + cd / && umount /mnt/ganesha + + echo "Trying To Mount By vers=4.1" + mount -t nfs -o vers=4.1 ${SERVER}:${EXPORT} /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since v4.1 Permissions Were Not Given To The Client" + exit ret + else + echo "SUCCESS ON v4.1 MOUNT FAILURE" + fi + + cd / && umount /mnt/ganesha + +fi + +if [ "$1" = "client_stage3" ] +then + echo "Client Stage 3 --- With Only Rights For v4.0 & v4.1 Mount To This Client " + + echo "Trying To Mount By vers=3" + mount -t nfs -o vers=3 ${SERVER}:${EXPORT} /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since v3 Permissions Were Not Given To The Client" + exit ret + else + echo "SUCCESS ON v3 MOUNT FAILURE" + fi + + cd / && umount /mnt/ganesha + + echo "Trying To Mount By vers=4.0 using normal path and not the pseudo path" + mount -t nfs -o vers=4.0 ${SERVER}:${EXPORT} /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since v4 Mounts Are To Use Pseudo Paths" + exit ret + else + echo "SUCCESS ON v4.0 MOUNT FAILURE DUE TO NOT USING PSEUDO PATH" + fi + + echo "Trying To Mount By vers=4.0" + mount -t nfs -o vers=4.0 ${SERVER}:/ppath /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS ON v4.0 MOUNT BY CLIENT" + else + echo "FAILURE ON v4.0 MOUNT BY CLIENT" + exit ret + fi + + cd / && umount /mnt/ganesha + + echo "Trying To Mount By vers=4.1" + mount -t nfs -o vers=4.1 ${SERVER}:/ppath /mnt/ganesha + ret=$? + if [ $ret -eq 0 ] + then + echo "SUCCESS ON v4.1 MOUNT BY CLIENT" + else + echo "FAILURE ON v4.1 MOUNT BY CLIENT" + exit ret + fi + + cd / && umount /mnt/ganesha + +fi + + +if [ "$1" = "client_stage4" ] +then + echo "Client Stage 4 --- With Squashed Root Mount To Clients " + + mount -t nfs ${SERVER}:${EXPORT} /mnt/ganesha + + echo "Trying To Change Ownership Of The File testFile.txt in the mount" + sudo chown root /mnt/ganesha/testFile.txt + + ret=$? + if [ $ret -eq 0 ] + then + echo "FAILURE Since Root Permissions Were Not Given To The Client" + exit ret + else + echo "SUCCESS ON chown Permission Denied" + fi + + cd / && umount /mnt/ganesha + +fi + + + + + diff --git a/export_params/duffy.py b/export_params/duffy.py new file mode 100644 index 00000000..281e580b --- /dev/null +++ b/export_params/duffy.py @@ -0,0 +1,148 @@ +# +# from: https://raw.githubusercontent.com/kbsingh/centos-ci-scripts/master/build_python_script.py +# +# This script uses the Duffy node management api to get fresh machines to run +# your CI tests on. Once allocated you will be able to ssh into that machine +# as the root user and setup the environ +# +# XXX: You need to add your own api key below, and also set the right cmd= line +# needed to run the tests +# +# Please note, this is a basic script, there is no error handling and there are +# no real tests for any exceptions. Patches welcome! + +import json, urllib, subprocess, sys, os, time + +url_base="http://admin.ci.centos.org:8080" +ver=os.getenv("CENTOS_VERSION") +arch=os.getenv("CENTOS_ARCH") +count=2 +server_script=os.getenv("SERVER_TEST_SCRIPT") +client_script=os.getenv("CLIENT_TEST_SCRIPT") + +# delay for 5 minutes (duffy timeout for rate limiting) +retry_delay=300 +# retry maximum 3 hours, that is 3 x 60 x 60 seconds +max_retries=((3 * 60 * 60) / retry_delay) + +# read the API key for Duffy from the ~/duffy.key file +fo=open("/home/nfs-ganesha/duffy.key") +api=fo.read().strip() +fo.close() + +# build the URL to request the system(s) +get_nodes_url="%s/Node/get?key=%s&ver=%s&arch=%s&count=%s" % (url_base,api,ver,arch,count) + +# request the system(s) +retries=0 +while retries < max_retries: + try: + dat=urllib.urlopen(get_nodes_url).read() + b=json.loads(dat) + # all is fine, break out of the loop + break + except ValueError, ve: + print("Failed to parse Duffy response: %s" % (dat)) + except Error, e: + print("An unexpected error occured: %s" % (e)) + + retries+=1 + print("Waiting %d seconds before retrying #%d..." % (retry_delay, retries)) + time.sleep(retry_delay) + + +# NFS-Ganesha Server (parameters need double escape, passed on ssh commandline) +server_env="export GERRIT_HOST='%s'" % os.getenv("GERRIT_HOST") +server_env+=" GERRIT_PROJECT='%s'" % os.getenv("GERRIT_PROJECT") +server_env+=" GERRIT_REFSPEC='%s'" % os.getenv("GERRIT_REFSPEC") +server_env+=" YUM_REPO='%s'" % os.getenv("YUM_REPO", "") +server_env+=" GLUSTER_VOLUME='%s'" % os.getenv("EXPORT") +server_env+=" ENABLE_ACL='%s'" % os.getenv("ENABLE_ACL", "") +server_env+=" CLIENT='%s'" % b['hosts'][1] + +# add the export with environment to ~/.bashrc +cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' +tee -a ~/.bashrc' <<< "%s" +""" % (b['hosts'][0], server_env) +subprocess.call(cmd, shell=True) + +cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + yum -y install curl && + curl -o server_script.sh %s && + bash server_script.sh server_initialization +'""" % (b['hosts'][0], server_script) +rtn_code=subprocess.call(cmd, shell=True) + +# check rtn_code and skip client part after failure +if rtn_code == 0: + # NFS-Client (parameters need double escape, passed on ssh commandline) + client_env="export SERVER='%s'" % b['hosts'][0] + client_env+=" EXPORT='/%s'" % os.getenv("EXPORT") + client_env+=" TEST_PARAMETERS='%s'" % os.getenv("TEST_PARAMETERS", "") + + # add the export with environment to ~/.bashrc + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + tee -a ~/.bashrc' <<< "%s" + """ % (b['hosts'][1], client_env) + subprocess.call(cmd, shell=True) + + client_script = client_script.strip(" ") + if client_script.endswith(".py"): + interpreter_to_run = "python" + elif client_script.endswith(".sh"): + interpreter_to_run = "bash" + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + curl -o client_script %s && + %s client_script client_initialization + '""" % (b['hosts'][1], client_script, interpreter_to_run) + rtn_code=subprocess.call(cmd, shell=True) + + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + bash server_script.sh server_stage1 + '""" % (b['hosts'][0]) + rtn_code=subprocess.call(cmd, shell=True) + + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + %s client_script client_stage1 + '""" % (b['hosts'][1], interpreter_to_run) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + bash server_script.sh server_stage2 + '""" % (b['hosts'][0]) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + %s client_script client_stage2 + '""" % (b['hosts'][1], interpreter_to_run) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + bash server_script.sh server_stage3 + '""" % (b['hosts'][0]) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + %s client_script client_stage3 + '""" % (b['hosts'][1], interpreter_to_run) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + bash server_script.sh server_stage4 + '""" % (b['hosts'][0]) + rtn_code=subprocess.call(cmd, shell=True) + + cmd="""ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%s ' + %s client_script client_stage4 + '""" % (b['hosts'][1], interpreter_to_run) + rtn_code=subprocess.call(cmd, shell=True) + + +# return the system(s) to duffy +done_nodes_url="%s/Node/done?key=%s&ssid=%s" % (url_base, api, b['ssid']) +das=urllib.urlopen(done_nodes_url).read() + +sys.exit(rtn_code) diff --git a/export_params/server.sh b/export_params/server.sh new file mode 100644 index 00000000..2474e8f2 --- /dev/null +++ b/export_params/server.sh @@ -0,0 +1,274 @@ +#!/bin/sh +# +# Setup a simple gluster environment and export a volume through NFS-Ganesha. +# +# This script uses the following environment variables: +# - GLUSTER_VOLUME: name of the gluster volume to create +# this name will also be used as name for the export +# +# The YUM_REPO and GERRIT_* variables are mutually exclusive. +# +# - YUM_REPO: URL to the yum repository (.repo file) for the NFS-Ganesha +# packages. When this option is used, libntirpc-latest is enabled +# as well. Leave empty in case patches from Gerrit need testing. +# +# - GERRIT_HOST: when triggered from a new patch submission, this is set to the +# git server that contains the repository to use. +# +# - GERRIT_PROJECT: project that triggered the build (like ffilz/nfs-ganesha). +# +# - GERRIT_REFSPEC: git tree-ish that can be fetched and checked-out for testing. + + +# abort if anything fails +set -e + +[ -n "${GLUSTER_VOLUME}" ] + +# be a little bit more verbose +set -x + +if [ "$1" = "server_initialization" ] +then + echo "======= In Server Initialization ==========" + + # enable repositories + yum -y install centos-release-gluster yum-utils + + # make sure rpcbind is running + yum -y install rpcbind + systemctl start rpcbind + + # CentOS 7.4.1708 has an SELinux issue that prevents NFS-Ganesha from creating + # the /var/log/ganesha/ganesha.log file. Starting ganesha.nfsd fails due to + # this. + echo 'TODO: this is BAD, needs a fix in the selinux-policy' + setenforce 0 + + if [ -n "${YUM_REPO}" ] + then + yum-config-manager --add-repo=http://artifacts.ci.centos.org/nfs-ganesha/nightly/libntirpc/libntirpc-latest.repo + yum-config-manager --add-repo=${YUM_REPO} + + # install the latest version of gluster + yum -y install nfs-ganesha nfs-ganesha-gluster glusterfs-ganesha + + # start nfs-ganesha service + if ! systemctl start nfs-ganesha + then + echo "+++ systemctl status nfs-ganesha.service +++" + systemctl status nfs-ganesha.service + echo "+++ journalctl -xe +++" + journalctl -xe + exit 1 + fi + else + [ -n "${GERRIT_HOST}" ] + [ -n "${GERRIT_PROJECT}" ] + [ -n "${GERRIT_REFSPEC}" ] + + GIT_REPO=$(basename "${GERRIT_PROJECT}") + GIT_URL="https://${GERRIT_HOST}/${GERRIT_PROJECT}" + + # install NFS-Ganesha build dependencies + yum -y --enablerepo=centos-gluster*-test install glusterfs-api-devel + yum -y install git bison flex cmake gcc-c++ libacl-devel krb5-devel \ + dbus-devel libnfsidmap-devel libwbclient-devel libcap-devel \ + libblkid-devel rpm-build redhat-rpm-config + + git init "${GIT_REPO}" + pushd "${GIT_REPO}" + + git fetch "${GIT_URL}" "${GERRIT_REFSPEC}" + git checkout -b "${GERRIT_REFSPEC}" FETCH_HEAD + + # update libntirpc + git submodule update --init || git submodule sync + + mkdir build + pushd build + + cmake -DCMAKE_BUILD_TYPE=Maintainer -DBUILD_CONFIG=everything ../src + make dist + rpmbuild -ta --define "_srcrpmdir $PWD" --define "_rpmdir $PWD" *.tar.gz + rpm_arch=$(rpm -E '%{_arch}') + ganesha_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p *.src.rpm) + if [ -e ${rpm_arch}/libntirpc-devel*.rpm ]; then + ntirpc_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p ${rpm_arch}/libntirpc-devel*.rpm) + ntirpc_rpm=${rpm_arch}/libntirpc-${ntirpc_version}.${rpm_arch}.rpm + fi + yum -y install ${ntirpc_rpm} ${rpm_arch}/nfs-ganesha-{,gluster-}${ganesha_version}.${rpm_arch}.rpm + + # start nfs-ganesha service with an empty configuration + > /etc/ganesha/ganesha.conf + if ! systemctl start nfs-ganesha + then + echo "+++ systemctl status nfs-ganesha.service +++" + systemctl status nfs-ganesha.service + echo "+++ journalctl -xe +++" + journalctl -xe + exit 1 + fi + fi + + # create and start gluster volume + yum -y install glusterfs-server + systemctl start glusterd + mkdir -p /bricks/${GLUSTER_VOLUME} + gluster volume create ${GLUSTER_VOLUME} \ + replica 2 \ + $(hostname --fqdn):/bricks/${GLUSTER_VOLUME}/b{1,2} force + + gluster volume start ${GLUSTER_VOLUME} force + + #disable gluster-nfs + #gluster v set vol1 nfs.disable on + #sleep 2 + + #enable cache invalidation + #gluster v set vol1 cache-invalidation on + + # TODO: open only the ports needed? + # disable the firewall, otherwise the client can not connect + systemctl stop firewalld || service iptables stop + + # TODO: SELinux prevents creating special files on Gluster bricks (bz#1331561) + setenforce 0 + + # Export the volume + mkdir -p /usr/libexec/ganesha + cd /usr/libexec/ganesha + yum -y install wget + wget https://raw.githubusercontent.com/gluster/glusterfs/release-3.10/extras/ganesha/scripts/create-export-ganesha.sh + wget https://raw.githubusercontent.com/gluster/glusterfs/release-3.10/extras/ganesha/scripts/dbus-send.sh + chmod 755 create-export-ganesha.sh dbus-send.sh + + /usr/libexec/ganesha/create-export-ganesha.sh /etc/ganesha on ${GLUSTER_VOLUME} + /usr/libexec/ganesha/dbus-send.sh /etc/ganesha on ${GLUSTER_VOLUME} + + # wait till server comes out of grace period + sleep 90 + + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" + + #Parsing export id from volume export conf file + export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') + + # basic check if the export is available, some debugging if not + if ! showmount -e | grep -q -w -e "${GLUSTER_VOLUME}" + then + echo "+++ /var/log/ganesha.log +++" + cat /var/log/ganesha.log + echo + echo "+++ /etc/ganesha/ganesha.conf +++" + grep --with-filename -e '' /etc/ganesha/ganesha.conf + echo + echo "+++ /etc/ganesha/exports/*.conf +++" + grep --with-filename -e '' /etc/ganesha/exports/*.conf + echo + echo "Export ${GLUSTER_VOLUME} is not available" + exit 1 + fi + + echo "============Displaying Initial Configuration File=============================" + cat /etc/ganesha/exports/export.${GLUSTER_VOLUME}.conf + + #Enabling ACL for the volume if ENABLE_ACL param is set to True + if [ "${ENABLE_ACL}" == "True" ] + then + sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g ${conf_file} + cat ${conf_file} + + dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/exports/export.${GLUSTER_VOLUME}.conf string:"EXPORT(Export_Id = 2)" + fi + +fi + +if [ "$1" = "server_stage1" ] +then + echo "======= SERVER STAGE 1 ==========" + + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" + + #Parsing export id from volume export conf file + export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') + + sed -i '12s/.*/\t\tAccess_type = RO;/' ${conf_file} + + echo "UPDATED EXPORT FILE" + cat ${conf_file} + + dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" + + sleep 15 + echo "++++++++Export Data Updated+++++++++" +fi + +if [ "$1" = "server_stage2" ] +then + echo "======= SERVER STAGE 2 ==========" + + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" + + #Parsing export id from volume export conf file + export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') + + sed -i '12s/.*/\t\tAccess_type = RO;/' ${conf_file} + sed -i '16s/.*/\t\tProtocols = "3";/' ${conf_file} + + echo "UPDATED EXPORT FILE" + cat ${conf_file} + + dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" + + sleep 15 + echo "++++++++Export Data Updated+++++++++" +fi + +if [ "$1" = "server_stage3" ] +then + echo "======= SERVER STAGE 3 ==========" + + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" + + #Parsing export id from volume export conf file + export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') + + sed -i '15s/.*/\tPseudo="\/ppath";/' ${conf_file} + sed -i '16s/.*/\t\tProtocols = "4";/' ${conf_file} + + echo "UPDATED EXPORT FILE" + cat ${conf_file} + + dbus-send --system --print-reply --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport uint16:${export_id} + + sleep 10 + + dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" + + sleep 15 + echo "++++++++Export Data Updated+++++++++" +fi + +if [ "$1" = "server_stage4" ] +then + echo "======= SERVER STAGE 4 ==========" + + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" + + #Parsing export id from volume export conf file + export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') + + sed -i '14s/.*/\t\tSquash = "root_squash";/' ${conf_file} + sed -i '16s/.*/\t\tProtocols = "3","4";/' ${conf_file} + + echo "UPDATED EXPORT FILE" + cat ${conf_file} + + dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" + + sleep 15 + echo "++++++++Export Data Updated+++++++++" +fi + +