From fd5e1a73f707e0b0494e2d4dd5208a3da035d823 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 13 May 2008 23:33:16 +0000 Subject: [PATCH] -Awk file transfers to xcatd are retried in most places -blade plugin will retry more to scale reliably git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1382 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/blade.pm | 4 +-- xCAT-server-2.0/sbin/xcatd | 4 +-- .../share/xcat/install/scripts/post.rh | 9 +++++++ .../share/xcat/install/scripts/post.rh.iscsi | 7 +++++ .../share/xcat/install/scripts/post.sles | 7 +++++ xCAT/postscripts/remoteshell | 26 +++++++++++++++++++ xCAT/postscripts/xcatclient | 7 +++++ xCAT/postscripts/xcatdsklspost | 10 +++++++ 8 files changed, 70 insertions(+), 4 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/lib/xcat/plugins/blade.pm index 7c59d1637..b7a4189f9 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/blade.pm @@ -1945,8 +1945,8 @@ sub dompa { PrivProto => 'DES', SecLevel => 'authPriv', UseNumeric => 1, - Retries => 2, # Give up sooner to make commands go smoother - Timeout=>1300000, #Beacon, for one, takes a bit over a second to return + Retries => 4, # Give up sooner to make commands go smoother + Timeout=>1500000, #Beacon, for one, takes a bit over a second to return PrivPass => $mpahash->{$mpa}->{password}); if ($session->{ErrorStr}) {return 1,$session->{ErrorStr}; } unless ($session and keys %$session) { diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 372f341eb..d80ca4e63 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -477,7 +477,7 @@ until ($quit) { next unless my $cnnection=$listener->accept; my $connection; while ($sslclients > $maxsslclients) { #THROTTLE - yield; + sleep 0.1; #Keep processor utilization down } my $child = xCAT::Utils->xfork(); #Yes we fork, IO::Socket::SSL is not threadsafe.. @@ -1063,7 +1063,7 @@ sub service_connection { } } $SIG{ALRM}= sub { die "Failure shutting down" }; - alarm(5); + alarm(10); foreach (keys %tables) { $tables{$_}->commit; } diff --git a/xCAT-server-2.0/share/xcat/install/scripts/post.rh b/xCAT-server-2.0/share/xcat/install/scripts/post.rh index 5a5659254..be0c37d36 100644 --- a/xCAT-server-2.0/share/xcat/install/scripts/post.rh +++ b/xCAT-server-2.0/share/xcat/install/scripts/post.rh @@ -55,6 +55,15 @@ do rm -rf $i chmod +x /xcatpost/* /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10+10 + sleep $SLI + /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + done + + chmod +x /tmp/mypostscript GOTIT=1 break diff --git a/xCAT-server-2.0/share/xcat/install/scripts/post.rh.iscsi b/xCAT-server-2.0/share/xcat/install/scripts/post.rh.iscsi index 1ba6a4c37..0bbbc691f 100644 --- a/xCAT-server-2.0/share/xcat/install/scripts/post.rh.iscsi +++ b/xCAT-server-2.0/share/xcat/install/scripts/post.rh.iscsi @@ -55,6 +55,13 @@ do rm -rf $i chmod +x /xcatpost/* /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10+10 + sleep $SLI + /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + done chmod +x /tmp/mypostscript GOTIT=1 break diff --git a/xCAT-server-2.0/share/xcat/install/scripts/post.sles b/xCAT-server-2.0/share/xcat/install/scripts/post.sles index 03a5b0e19..773b0fcf0 100644 --- a/xCAT-server-2.0/share/xcat/install/scripts/post.sles +++ b/xCAT-server-2.0/share/xcat/install/scripts/post.sles @@ -85,6 +85,13 @@ do rm -rf $i chmod +x /xcatpost/* /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10+10 + sleep $SLI + /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript + MYCONT=`cat /tmp/mypostscript` + done chmod +x /tmp/mypostscript GOTIT=1 break diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 692a94e94..9d7b88c0f 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -43,11 +43,27 @@ allowcred.awk & CREDPID=$! sleep 1 getcredentials.awk ssh_dsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_dsa_key +MYCONT=`cat /etc/ssh/ssh_host_dsa_key` +while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10 + let SLI=SLI+10 + sleep $SLI + getcredentials.awk ssh_dsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_dsa_key + MYCONT=`cat /etc/ssh/ssh_host_dsa_key` +done chmod 600 /etc/ssh/ssh_host_dsa_key if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_dsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_dsa_key fi getcredentials.awk ssh_rsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_rsa_key +MYCONT=`cat /etc/ssh/ssh_host_rsa_key` +while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10 + let SLI=SLI+10 + sleep $SLI + getcredentials.awk ssh_rsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_rsa_key + MYCONT=`cat /etc/ssh/ssh_host_rsa_key` +done chmod 600 /etc/ssh/ssh_host_rsa_key if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_rsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_rsa_key @@ -61,6 +77,16 @@ umask 0077 mkdir -p /root/.ssh/ sleep 1 getcredentials.awk ssh_root_key | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.ssh/id_rsa +MYCONT=`cat /root/.ssh/id_rsa` +while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10 + let SLI=SLI+10 + sleep $SLI + getcredentials.awk ssh_root_key | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.ssh/id_rsa + MYCONT=`cat /root/.ssh/id_rsa` +done + + if ! grep "PRIVATE KEY" /root/.ssh/id_rsa > /dev/null 2>&1 ; then rm /root/.ssh/id_rsa fi diff --git a/xCAT/postscripts/xcatclient b/xCAT/postscripts/xcatclient index 6d56a855b..faf1c2d84 100644 --- a/xCAT/postscripts/xcatclient +++ b/xCAT/postscripts/xcatclient @@ -13,6 +13,13 @@ if [ ! -x /usr/sbin/stunnel ]; then #Stop if no stunnel to help the next bit mkdir -p /root/.xcat chmod 700 /root/.xcat getcredentials.awk xcat_client_cred | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.xcat/client-cred.pem + CONT=`cat /root/.xcat/client-cred.pem` + while [ -z "$CONT" ]; do + let SLI=$RANDOM%10+10 + sleep $SLI + getcredentials.awk xcat_client_cred | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.xcat/client-cred.pem + CONT=`cat /root/.xcat/client-cred.pem` + done chmod 600 /root/.xcat/client-cred.pem cp _xcat/ca.pem /root/.xcat/ca.pem kill -9 $CREDPID diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index acbb2cb45..84742bb8a 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -11,6 +11,8 @@ if [ ! `uname` == Linux ]; then exec $MYDIR/xcatdsklspost.aix exit fi +let SLI=$RANDOM%10 +sleep $SLI SIP=`grep dhcp-server-identifier /var/lib/dhclient/dhclient-eth0.leases|tail -n 1|awk '{print $3}'|sed -e 's/;//'` if grep 'rw /rw tmpfs ' /proc/mounts >& /dev/null; then @@ -48,6 +50,14 @@ PATH=/xcatpost:$PATH export PATH chmod +x /xcatpost/*; /xcatpost/getpostscript.awk | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript; +MYCONT=`cat /tmp/mypostscript` +while [ -z "$MYCONT" ]; do + let SLI=$RANDOM%10 + let SLI=10+$SLI + sleep $SLI + /xcatpost/getpostscript.awk | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript; + MYCONT=`cat /tmp/mypostscript` +done chmod +x /tmp/mypostscript if [ -x /tmp/mypostscript ];then /tmp/mypostscript