From f0c8be68ca68ddb067a40830fecf389c74c13d02 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 6 Jun 2014 18:43:15 -0700 Subject: scripts: CTDB lockvol ping-timeout should be 10secs commit "4044e387dd40e2d12145fd32d5fd715406fcec8e" approach to this led to deadlocks instead we rely on an old trick at client side - without any need to modifying the volume globally. Change-Id: I6e3c6bf9c0a3a0dd99a51b5d2a6c1f050ed2384c BUG: 1091600 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/8007 Reviewed-by: Raghavendra Talur Reviewed-by: Poornima G Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- extras/hook-scripts/stop/pre/S29CTDB-teardown.sh | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'extras/hook-scripts/stop') diff --git a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh index bfbd356b8fa..9125030bb7e 100755 --- a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh +++ b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh @@ -58,15 +58,20 @@ function remove_ctdb_options () { } function remove_fstab_entry () { - volname=$1 - mntpt=$2 - mntent="`hostname`:/$volname $mntpt glusterfs _netdev,defaults,transport=tcp 0 0" - esc_mntent=$(echo -e "$mntent" | sed 's/\//\\\//g') - exists=`grep "^$mntent" /etc/fstab` - if [ "$exists" != " " ] - then - sed -i /"$esc_mntent"/d /etc/fstab - fi + mntpt=$1 + fstab="/etc/fstab" + exists=`grep "$mntpt" ${fstab}` + esc_mntpt=$(echo -e $mntpt | sed 's/\//\\\//g') + if [ "$exists" != " " ] + then + sed -i /"$esc_mntpt"/d $fstab + exists=`grep "$mntpt" ${fstab}` + if [ "$exists" != " " ] + then + echo "fstab entry cannot be removed for unknown reason" + exit 1 + fi + fi } parse_args $@ @@ -74,7 +79,7 @@ if [ "$META" = "$VOL" ] then umount "$CTDB_MNT" chkconfig ctdb off - remove_fstab_entry $VOL $CTDB_MNT + remove_fstab_entry $CTDB_MNT remove_ctdb_options sighup_samba fi -- cgit