From 388adc01092ed5294f9bf4b0c1eda947c30ec0ef Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 29 Dec 2011 10:36:57 +0000 Subject: [PATCH] add retrying for the syncfiles postscript git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11315 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/syncfiles | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/xCAT/postscripts/syncfiles b/xCAT/postscripts/syncfiles index 56022f33a..7a7c0b612 100644 --- a/xCAT/postscripts/syncfiles +++ b/xCAT/postscripts/syncfiles @@ -28,15 +28,28 @@ osname=`uname` xcatpostdir="/xcatpost" logger -t xCAT "$0: the OS name = $osname" -if [ $osname = "Linux" ] -then -`$xcatpostdir/startsyncfiles.awk` -returncode=$? -elif [ $osname = "AIX" ] -then -`$xcatpostdir/startsyncfiles.aix` -returncode=$? -fi +quit="no" +count=5 +while [ $quit = "no" ]; do + if [ $osname = "Linux" ] + then + `$xcatpostdir/startsyncfiles.awk` + returncode=$? + elif [ $osname = "AIX" ] + then + `$xcatpostdir/startsyncfiles.aix` + returncode=$? + fi + + if [ $returncode -eq 0 ] || [ $count -eq 0 ]; then + quit="yes" + else + let SLI=$RANDOM%10 + let SLI=SLI+10 + sleep $SLI + fi + let count=count-1 +done if [ $returncode -eq 0 ] then