From 82719795efe58bd47d9fb8decf16c1dd6291331e Mon Sep 17 00:00:00 2001 From: jjhua Date: Tue, 28 Aug 2012 11:43:52 +0000 Subject: [PATCH] updatenode performance enhancement.1. get the /postscripts.tgz firstly, if fails, try the original procedure; 2, remove the sleep() action in xcatdsklspost script, because Jarrod did some enhancement in xcatd git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13626 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3c4fd85fc..65bda869a 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -48,11 +48,19 @@ download_postscripts() retry=0 rc=1 while [ 0 -eq 0 ]; do - wget -l inf -nH -N -r --waitretry=10 --random-wait -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /xcatpost 2> /tmp/wget.log + + wget -N --waitretry=10 --random-wait -T 60 http://$server$INSTALLDIR/postscripts.tgz -P /xcatpost 2> /tmp/wget.log rc=$? if [ $rc -eq 0 ]; then return 0; + else + wget -l inf -nH -N -r --waitretry=10 --random-wait -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /xcatpost 2> /tmp/wget.log + rc=$? + + if [ $rc -eq 0 ]; then + return 0; + fi fi retry=$(($retry+1)) @@ -99,8 +107,8 @@ if [ ! `uname` = Linux ]; then exec $MYDIR/xcatdsklspost.aix exit fi -SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') -sleep $SLI +#SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') +#sleep $SLI if [ ! -d /xcatpost ]; then mkdir -p /xcatpost; @@ -243,6 +251,10 @@ if grep 'rw /rw tmpfs ' /proc/mounts >/dev/null 2>&1; then ln -sf /etc/rc6.d/K10xcatmounts /etc/rc0.d/K10xcatmounts fi +if [ -f /xcatpost/postscripts.tgz ]; then + tar xzf /xcatpost/postscripts.tgz -C /xcatpost/ 2>/dev/null +fi + chmod +x /xcatpost/*; cd /xcatpost; @@ -270,9 +282,9 @@ while [ -z "$MYCONT" ]; do break fi - SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') - SLI=$((10 + $SLI)) - sleep $SLI + #SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') + #SLI=$((10 + $SLI)) + #sleep $SLI /xcatpost/getpostscript.awk | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; MYCONT=`grep MASTER /xcatpost/mypostscript`