From 3d8d17523dc8ff93de1a67c485e88728fa4d26b3 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 7 May 2008 17:27:59 +0000 Subject: [PATCH] -Fix problem where wcons with bad noderange would behave quite badly -Have wcons pause for input if the xterm would close within 5 seconds of creation git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1312 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client-2.0/bin/wcons | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-client-2.0/bin/wcons b/xCAT-client-2.0/bin/wcons index 88d711f63..1dd829224 100755 --- a/xCAT-client-2.0/bin/wcons +++ b/xCAT-client-2.0/bin/wcons @@ -22,6 +22,9 @@ unless ($ARGV[$#ARGV]) { exit 1; } my $nodes=`nodels $ARGV[$#ARGV]`; +unless ($nodes) { + exit 1; +} my $conservers=`nodels $ARGV[$#ARGV] nodehm.conserver`; pop @ARGV; my @conservers=split /\n/,$conservers; @@ -45,6 +48,9 @@ foreach (@nodes) { my $firstnode = shift @nodes; +unless ($firstnode) { + exit 1; +} my $currx; my $curry; my $wmxo; @@ -75,7 +81,7 @@ if (defined($tilefact)) { } - system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $firstnode -title $firstnode -n $firstnode -geometry +0+0 -e /bin/sh -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & $mydir/rcons $firstnode ".$conservers{$firstnode}."\" &"); + system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $firstnode -title $firstnode -n $firstnode -geometry +0+0 -e /bin/sh -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi \" &"); sleep(2); #Give time for window manager to figure out everything my $xinfo = `xwininfo -name $firstnode`; my @xinfl = split(/\n/,$xinfo); @@ -111,7 +117,7 @@ if (defined($tilefact)) { $currx=0; } } else { - system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $firstnode -title $firstnode -n $firstnode -e /bin/sh -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & $mydir/rcons $firstnode ".$conservers{$firstnode}."\" &"); + system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $firstnode -title $firstnode -n $firstnode -e /bin/sh -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi\" &"); } my $geometry=""; @@ -130,7 +136,7 @@ foreach (@nodes) { } } - system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $_ -title $_ -n $_ $geometry -e /bin/sh -c \"$mydir/xtcd.pl .".$ENV{DISPLAY}." $_ $_ & $mydir/rcons $_ ".$conservers{$_}."\" &"); + system("xterm -bg black -fg white ".join(" ",@ARGV)." -name $_ -title $_ -n $_ $geometry -e /bin/sh -c \"$mydir/xtcd.pl .".$ENV{DISPLAY}." $_ $_ & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi\" &"); }