Skip to content

Commit ed51e4d

Browse files
author
Dougal Ballantyne
committed
Waiting longer for EBS volume to attach.
1 parent 06a3952 commit ed51e4d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bootstrap/src/scripts/boot_as_master

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,17 @@ chmod 1777 /scratch
109109
# Attach and mount /shared volume
110110
RC=0
111111
/usr/local/sbin/attachVolume.py ${cfn_volume} || RC=1
112-
sleep 10 # Hate having to do this...
112+
TRY=0
113+
while [ $TRY -lt 3 ]; do
114+
sleep 10
115+
stat /dev/disk/by-ebs-volumeid/${cfn_volume} 2>&1 >/dev/null
116+
check_stat=$?
117+
if [ $check_stat -eq 0 ]; then
118+
break
119+
else
120+
TRY=$(( $TRY + 1 ))
121+
fi
122+
done
113123
dev=$(stat /dev/disk/by-ebs-volumeid/${cfn_volume}|grep -- 'File:'|awk '{print $4}'|cut -d'/' -f3|tr -d "'")
114124
fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}')
115125
if [ "${fs_type}x" == "x" ]; then

0 commit comments

Comments
 (0)