From 13e24251128590bd26a1be77a518e9b3428986ef Mon Sep 17 00:00:00 2001 From: mxi1 Date: Wed, 16 Sep 2009 08:28:04 +0000 Subject: [PATCH] the defect 2847578 is fixed; one retry_number is added to avoid the infinit loop git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4144 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 09ae1ece2..43572958e 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -99,7 +99,17 @@ chmod +x /xcatpost/*; /xcatpost/getpostscript.awk | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript; MYCONT=`grep MASTER /tmp/mypostscript` #echo "MYCONT=$MYCONT" +#if getpostscript.awk fails, the postscript will fall into infinit loop +#so one retry_number is added to avoid sunc a condition +MAX_RETRIES=10 +RETRY=0 while [ -z "$MYCONT" ]; do + RETRY=$(($RETRY+1)) + if [ $RETRY -eq $MAX_RETRIES ] + then + break + fi + let SLI=$RANDOM%10 let SLI=10+$SLI sleep $SLI