From 48d331cd32c0d62882382db07d9ce2fc6add1eed Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 4 Mar 2008 21:15:40 +0000 Subject: [PATCH] Wrap wget with a lot of fault tolerance in the nbroot dodestiny git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@675 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot/overlay/bin/dodestiny | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-nbroot/overlay/bin/dodestiny b/xCAT-nbroot/overlay/bin/dodestiny index 0362bbc39..19a96b41c 100755 --- a/xCAT-nbroot/overlay/bin/dodestiny +++ b/xCAT-nbroot/overlay/bin/dodestiny @@ -102,8 +102,16 @@ while :; do INITRD=`grep initrd /tmp/destiny | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'` KERNEL=`grep kernel /tmp/destiny | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'` KCMD=`grep kcmdline /tmp/destiny | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'` - wget http://$IMGSERVER/tftpboot/$KERNEL -O /tmp/kernel - wget http://$IMGSERVER/tftpboot/$INITRD -O /tmp/initrd + ERROR=`wget http://$IMGSERVER/tftpboot/$KERNEL -O /tmp/kernel 2>&1` + while [ $? == 1 ] && echo $ERROR|grep -v 416; do + sleep 10 + ERROR=`wget -c http://$IMGSERVER/tftpboot/$KERNEL -O /tmp/kernel 2>&1` + done + ERROR=`wget -c http://$IMGSERVER/tftpboot/$INITRD -O /tmp/initrd 2>&1` + while [ $? == 1 ] && echo $ERROR|grep -v 416; do + sleep 10 + ERROR=`wget -c http://$IMGSERVER/tftpboot/$INITRD -O /tmp/initrd 2>&1` + done #START getting ready for kexec for mod in `lsmod|awk '{print $1}'|grep -v Module`; do rmmod $mod @@ -114,7 +122,11 @@ while :; do if [ "$DEST" == "runimage" ]; then mkdir /tmp/`basename $TARG` cd /tmp/`basename $TARG` - wget $TARG + ERROR=`wget $TARG` + while [ $? == 1 ] && echo $ERROR|grep -v 416; do + sleep 10 + ERROR=`wget -c $TARG 2>&1` + done while ! nextdestiny ; do echo "Retrying next destiny..." done