diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2015-03-17 09:27:05 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-03-17 13:39:44 -0700 |
commit | d81182cf69a4f188f304fcce6d651ffd56b67aac (patch) | |
tree | f71627c738d4424aa989805c9fe829f516ec6c51 /extras/ganesha/scripts/create-export-ganesha.sh | |
parent | c8be9af5f54aa3e42dffee4024d2915743258242 (diff) |
NFS-Ganesha: Install scripts, config files, and resource agent scripts
Resubmitting after a gerrit bug bungled the merge of
http://review.gluster.org/9621 (was it really a gerrit bug?)
Scripts related to NFS-Ganesha are in extras/ganesha/scripts.
Config files are in extras/ganesha/config.
Resource Agent files are in extras/ganesha/ocf
Files are copied to appropriate locations.
Change-Id: I137169f4d653ee2b7d6df14d41e2babd0ae8d10c
BUG: 1188184
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/9912
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras/ganesha/scripts/create-export-ganesha.sh')
-rwxr-xr-x | extras/ganesha/scripts/create-export-ganesha.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/extras/ganesha/scripts/create-export-ganesha.sh b/extras/ganesha/scripts/create-export-ganesha.sh new file mode 100755 index 00000000000..8140a11f548 --- /dev/null +++ b/extras/ganesha/scripts/create-export-ganesha.sh @@ -0,0 +1,55 @@ +#/bin/bash + +#This script is called by glusterd when the user +#tries to export a volume via NFS-Ganesha. +#An export file specific to a volume +#is created in GANESHA_DIR/exports. + +GANESHA_DIR=$1 +VOL=$2 + +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 + +CONF=$(cat /etc/sysconfig/ganesha | grep "CONFFILE" | cut -f 2 -d "=") +check_cmd_status `echo $?` + + +function write_conf() +{ +echo -e "# WARNING : Using Gluster CLI will overwrite manual +# changes made to this file. To avoid it, edit the +# file, copy it over to all the NFS-Ganesha nodes +# and run ganesha-ha.sh --refresh-config." + +echo "EXPORT{" +echo " Export_Id = 1;" +echo " FSAL {" +echo " name = "GLUSTER";" +echo " hostname=\"localhost\";" +echo " volume=\"$VOL\";" +echo " }" +echo " Access_type = RW;" +echo ' Squash="No_root_squash";' +echo " Pseudo=\"/$VOL\";" +echo ' Protocols = "3,4" ;' +echo ' Transports = "UDP,TCP";' +echo ' SecType = "sys";' +echo " }" +} + +write_conf $@ > $GANESHA_DIR/exports/export.$VOL.conf +echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF |