From a0e690fbdf5681c7cf644271de5cc03bde3fef8f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 4 Jan 2016 18:50:38 +0100 Subject: hook-scripts: S29CTDBsetup: clean and fix mount commands and options This refactors the mount options of S29CTDBstart.sh into one variable, removing the superfluous mentioning of 'default'. The manual mount command is fixed to: - also use the common options, thereby adding _netdev,transport=tcp (while this does not have an effect for the _netdev option, it makes a difference for the transport option), - also use the HOSTNAME variable just like the fstab entry, - use a "/" in the remote location specification. Hence it now behaves identically to the fstab mount. Change-Id: Ibb7613b1b1278ab13745846baa79268db226ef19 BUG: 1295520 Signed-off-by: Michael Adam Reviewed-on: http://review.gluster.org/13170 Tested-by: Raghavendra Talur Reviewed-by: Raghavendra Talur Reviewed-by: Rajesh Joseph NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- extras/hook-scripts/start/post/S29CTDBsetup.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'extras/hook-scripts/start/post') diff --git a/extras/hook-scripts/start/post/S29CTDBsetup.sh b/extras/hook-scripts/start/post/S29CTDBsetup.sh index f33aa2530ed..4265cba54ee 100755 --- a/extras/hook-scripts/start/post/S29CTDBsetup.sh +++ b/extras/hook-scripts/start/post/S29CTDBsetup.sh @@ -6,12 +6,12 @@ # to get CTDB based failover up and running. CTDB_MNT=/gluster/lock +# Make sure ping-timeout is not default for CTDB volume PING_TIMEOUT_SECS=10 PROGNAME="ctdb" OPTSPEC="volname:" HOSTNAME=`hostname` -MNTOPTS="_netdev,defaults" -MNTOPTS_GLUSTERFS="transport=tcp,xlator-option=*client*.ping-timeout=${PING_TIMEOUT_SECS}" +MNTOPTS="_netdev,transport=tcp,xlator-option=*client*.ping-timeout=${PING_TIMEOUT_SECS}" VOL= # $META is the volume that will be used by CTDB as a shared filesystem. # It is not desirable to use this volume for storing 'data' as well. @@ -45,7 +45,7 @@ function parse_args () { function add_fstab_entry () { volname=$1 mntpt=$2 - mntopts="${MNTOPTS},${MNTOPTS_GLUSTERFS}" + mntopts="${MNTOPTS}" mntent="${HOSTNAME}:/${volname} ${mntpt} glusterfs ${mntopts} 0 0" exists=`grep "${mntpt}" /etc/fstab` @@ -60,8 +60,7 @@ if [ "$META" = "$VOL" ] then mkdir -p $CTDB_MNT sleep 5 - # Make sure ping-timeout is not default for CTDB volume - mount -t glusterfs -oxlator-option=*client*.ping-timeout=${PING_TIMEOUT_SECS} `hostname`:$VOL "$CTDB_MNT" && \ + mount -t glusterfs -o${MNTOPTS} ${HOSTNAME}:/$VOL "$CTDB_MNT" && \ add_fstab_entry $VOL $CTDB_MNT chkconfig ctdb on fi -- cgit