From 68ca091681a3cfb136deae39ae9e087f54fc6fb4 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 12 Aug 2008 12:59:14 +0000 Subject: [PATCH] -Have Xen rcons script cycle until console parameters are available git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2012 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/cons/xen | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/cons/xen b/xCAT-server/share/xcat/cons/xen index 630b37c51..d6d17a670 100755 --- a/xCAT-server/share/xcat/cons/xen +++ b/xCAT-server/share/xcat/cons/xen @@ -5,8 +5,8 @@ BEGIN use Time::HiRes qw(sleep); $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; my $sleepint=int(rand(10)); - print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - sleep $sleepint; + print "Opening console in ".(0.5*$sleepint)." seconds...\n"; + sleep (0.5*$sleepint); } use lib "$::XCATROOT/lib/perl"; $ENV{HOME}='/root/'; @@ -37,6 +37,11 @@ sub getans { } } xCAT::Client::submit_request($cmdref,\&getans); +until ($dsthost and $speed and $dstty) { + print "console not ready"; + sleep 5+int(rand(10)); + xCAT::Client::submit_request($cmdref,\&getans); +} exec "ssh -t $dsthost cu -s $speed -l $dstty"; #my $pathtochild= dirname($scriptname). "/";