From 502cc6aaad99599d31616cf20ed62553fb6941fd Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 12 Nov 2014 03:38:16 -0500 Subject: [PATCH 1/7] fix bug 4271 Avoid use a seperate /boot partition in the default partition strategy for Ubuntu --- xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 index 0cb85c74b..ccdad4512 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 @@ -134,9 +134,9 @@ else echo ' $primary{ } $bootable{ } method{ prep }' >> /tmp/partitioning echo " ." >> /tmp/partitioning - echo "100 50 100 ext4" >> /tmp/partitioning - echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitioning - echo " ." >> /tmp/partitioning + #echo "100 50 100 ext4" >> /tmp/partitioning + #echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitioning + #echo " ." >> /tmp/partitioning fi echo "500 10000 1000000000 ext4" >> /tmp/partitioning echo " method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / }" >> /tmp/partitioning From 7ee1498601cfd70e36bf2bef4cdd7856be1f8d18 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 12 Nov 2014 03:40:54 -0500 Subject: [PATCH 2/7] fix for bug 4341: xCAT needs perl-Digest-SHA1 but RHEL7 will not install perl-Digest-SHA1 by default --- xCAT-server/xCAT-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 7320448a2..46fe1c6ee 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -25,7 +25,7 @@ AutoReqProv: no # also need to fix Requires for AIX %ifos linux BuildArch: noarch -Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser +Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 Obsoletes: atftp-xcat %endif From 2d1961c4f956295b909d92904a392b55eba7ad01 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 12 Nov 2014 10:24:38 -0500 Subject: [PATCH 3/7] bug#4286 makedns should have a verbose mode --- xCAT-client/pods/man8/makedns.8.pod | 8 ++- xCAT-server/lib/xcat/plugins/ddns.pm | 85 ++++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index 71ad50457..ecdc738be 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -6,9 +6,9 @@ B - sets up domain name services (DNS). B [I<-h>|I<--help>] -B [-e|--external] [I<-n>|I<--new>] [I] +B [-V|--verbose] [-e|--external] [I<-n>|I<--new>] [I] -B [-e|--external] [I<-d>|I<--delete> I] +B [-V|--verbose] [-e|--external] [I<-d>|I<--delete> I] =head1 DESCRIPTION @@ -37,6 +37,10 @@ Cluster_Name_Resolution =over 6 +=item B<-V>|B<--verbose> + +Verbose mode. + =item B<-n>|B<--new> Use this flag to create new named configuration and db files. diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 67a323c26..b41649019 100755 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -13,6 +13,7 @@ use MIME::Base64; use xCAT::SvrUtils; use Socket; use Fcntl qw/:flock/; +use Data::Dumper; # This is a rewrite of DNS management using nsupdate rather than # direct zone mangling @@ -52,7 +53,7 @@ sub getzonesfornet { die "Not supporting having a mask like $mask on an ipv6 network like $net"; } my $netnum= getipaddr($net,GetNumber=>1); - unless ($netnum) { return (); } + unless ($netnum) { return (); } $netnum->brsft(128-$maskbits); my $prefix=$netnum->as_hex(); my $nibbs=$maskbits/4; @@ -209,6 +210,7 @@ sub process_request { my $deletemode=0; my $external=0; my $slave=0; + my $VERBOSE; # Since the mandatory rpm perl-Net-DNS for makedns on sles12 (perl-Net-DNS-0.73-1.28) has a bug, # user has to update it to a newer version @@ -238,6 +240,7 @@ sub process_request { 'd|delete' => \$deletemode, 'e|external' => \$external, 's|slave' => \$slave, + 'V|verbose' => \$VERBOSE, 'h|help' => \$help, )) { #xCAT::SvrUtils::sendmsg([1,"TODO: makedns Usage message"], $callback); @@ -246,6 +249,12 @@ sub process_request { return; } } + if (defined($VERBOSE)) { + $::VERBOSE=$VERBOSE; + } else { + undef $::VERBOSE; + } + if ($::XCATSITEVALS{externaldns}) { $external=1; } @@ -275,6 +284,13 @@ sub process_request { return; } $ctx->{domain} = $site_entry; + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "domain name = $site_entry"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } if($external) #need to check if /etc/resolv.conf existing { @@ -287,7 +303,17 @@ sub process_request { $cmd = $acmd; } + my @output=xCAT::Utils->runcmd($cmd, 0); + if ($::VERBOSE) + { + my $rsp; + my $outp = join(', ', @output); + push @{$rsp->{data}}, + "output from /etc/resolv.conf: $outp"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + if ($::RUNCMD_RC != 0) { xCAT::SvrUtils::sendmsg([1,"You are using -e flag to update DNS records to an external DNS server, please ensure /etc/resolv.conf existing and pointed to this external DNS server."], $callback); @@ -310,6 +336,14 @@ sub process_request { umask($oldmask); return; } + + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "nameservers = $sitens"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } my $networkstab = xCAT::Table->new('networks',-create=>0); unless ($networkstab) { xCAT::SvrUtils::sendmsg([1,'Unable to enumerate networks, try to run makenetworks'], $callback); } @@ -499,6 +533,13 @@ sub process_request { my $currzone; foreach $currzone (getzonesfornet($_)) { $ctx->{zonestotouch}->{$currzone} = 1; + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "zone info for this $net: $currzone"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } } } my $passtab = xCAT::Table->new('passwd'); @@ -592,7 +633,17 @@ sub process_request { foreach (@nodes) { my @revzones = get_reverse_zones_for_entity($ctx,$_);; - unless (@revzones) { next; } + unless (@revzones) + { + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "No reverse zones for $_ "; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + next; + } $ctx->{revzones}->{$_} = \@revzones; foreach (@revzones) { $ctx->{zonestotouch}->{$_}=1; @@ -638,6 +689,14 @@ sub process_request { } unless ($external) { # only generate the named.conf and zone files for xCAT dns when NOT using external dns if ($zapfiles || $slave) { #here, we unlink all the existing files to start fresh + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "Stop named service"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + if (xCAT::Utils->isAIX()) { system("/usr/bin/stopsrc -s $service"); @@ -650,6 +709,14 @@ sub process_request { my $conf = get_conf(); unlink $conf; my $DBDir = get_dbdir(); + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "get_dbdir: $DBDir"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + foreach (<$DBDir/db.*>) { unlink $_; } @@ -658,7 +725,14 @@ sub process_request { $ctx->{dbdir} = get_dbdir(); $ctx->{zonesdir} = get_zonesdir(); chmod 0775, $ctx->{dbdir}; # assure dynamic dns can actually execute against the directory - + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "Update Named Conf dir $ctx->{dbdir} $ctx->{zonesdir}"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + update_namedconf($ctx, $slave); unless ($slave) @@ -1497,8 +1571,9 @@ sub makedns_usage "\n makedns - sets up domain name services (DNS)."; push @{$rsp->{data}}, " Usage: "; push @{$rsp->{data}}, "\tmakedns [-h|--help ]"; - push @{$rsp->{data}}, "\tmakedns [-e|--external] [-n|--new ] [noderange]"; - push @{$rsp->{data}}, "\tmakedns [-e|--external] [-d|--delete noderange]"; + push @{$rsp->{data}}, "\tmakedns [-V|--verbose]"; + push @{$rsp->{data}}, "\tmakedns [-V|--verbose] [-e|--external] [-n|--new ] [noderange]"; + push @{$rsp->{data}}, "\tmakedns [-V|--verbose] [-e|--external] [-d|--delete noderange]"; push @{$rsp->{data}}, "\n"; xCAT::MsgUtils->message("I", $rsp, $callback); return 0; From e2c31bad27f387a5c44df1ea4185003c7bce1d91 Mon Sep 17 00:00:00 2001 From: jjohnson2 Date: Wed, 12 Nov 2014 16:48:44 -0500 Subject: [PATCH 4/7] Implement confluent usage by r/wcons --- xCAT-client/bin/rcons | 22 +++++++++++++++++++++- xCAT-client/bin/wcons | 26 +++++++++++++++++++++----- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 78bd8e901..09c0522c8 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -52,7 +52,27 @@ if [ -n "$2" ]; then fi fi -if [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then +if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ]; then + #use confluent + CONFETTY="confetty" + if [ -x "/opt/confluent/bin/confetty" ]; then + CONFETTY="/opt/confluent/bin/confetty" + fi + if [ ! -z "$CONSCONTROLPATH" ]; then + CONSCONTROLPATH="-c $CONSCONTROLPATH" + fi + if [ -z "$CONSERVER" ]; then + CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '` + fi + + if [ -z "$CONSERVER" ]; then + CONSERVER=$XCATHOST + fi + if [ ! -z "$CONSERVER" ]; then + CONSERVER="-s $CONSERVER" + fi + $CONFETTY $CONSCONTROLPATH $CONSERVER $1 +elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then #use conserver if [ -z "$CONSERVER" ]; then CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '` diff --git a/xCAT-client/bin/wcons b/xCAT-client/bin/wcons index 13a95dcb0..abb1df1d9 100755 --- a/xCAT-client/bin/wcons +++ b/xCAT-client/bin/wcons @@ -3,6 +3,8 @@ use Getopt::Long qw(:config getopt_compat pass_through); use File::Basename; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } +use IO::Socket::UNIX; +use Time::HiRes qw/sleep/; use lib "$::XCATROOT/lib/perl"; use xCAT::Client; #use Data::Dumper; @@ -54,7 +56,6 @@ foreach (@nodes) { $conservers{$_} =~ s/:.*//; next; } - $conservers{$_} = 'localhost'; } @@ -82,7 +83,7 @@ if (defined($tilefact)) { $screenheight=$1; } } - $rootinf = `xwininfo -name "Top Panel"`; + $rootinf = `xwininfo -name "Top Panel" 2> /dev/null`; foreach (split /\n/,$rootinf) { if (/-geometry\s+([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)/) { if ($1 > 640 and $2 < 480 and $3 == 0 and $4 == 0) { @@ -91,7 +92,7 @@ if (defined($tilefact)) { } } if ($panel_pad == 0) { - $rootinf = `xwininfo -name "Top Expanded Edge Panel"`; + $rootinf = `xwininfo -name "Top Expanded Edge Panel" 2> /dev/null`; foreach (split /\n/,$rootinf) { if (/-geometry\s+([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)/) { if ($1 > 640 and $2 < 480 and $3 == 0 and $4 == 0) { @@ -102,9 +103,24 @@ if (defined($tilefact)) { } + $ENV{CONSCONTROLPATH} = "/tmp/wconscontrol.$firstnode.$$"; system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode -geometry +0+0 ".join(" ",@ARGV)." -e /bin/bash -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 $remainwait = 2; + while (not -S "/tmp/wconscontrol.$firstnode.$$" and $remainwait > 0) { + sleep(0.1); + $remainwait -= 0.1; + } + my $xinfo; + if (-S "/tmp/wconscontrol.$firstnode.$$") { # confluent mode + my $controlchannel = IO::Socket::UNIX->new(Type=>SOCK_STREAM(), Peer => "/tmp/wconscontrol.$firstnode.$$"); + print $controlchannel "GETWINID\n"; + my $winid = <$controlchannel>; + $winid = <$controlchannel>; + $xinfo = `xwininfo -id $winid`; + } else { + $xinfo = `xwininfo -name $firstnode`; + } + my @xinfl = split(/\n/,$xinfo); my $side_pad; my $wmxo; From b4d916734481bdce8b9097b7e12f47af6b322e0c Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 12 Nov 2014 21:34:33 -0500 Subject: [PATCH 5/7] fix bug 4382 :increase /tmp size for default ubuntu diskless node --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2c3415189..2b41a05cd 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -1568,8 +1568,8 @@ sub generic_post { #This function is meant to leave the image in a state approxi print $cfgfile "tmpfs /tmp tmpfs defaults,size=$tmplimit 0 2\n"; print $cfgfile "tmpfs /var/tmp tmpfs defaults,size=$tmplimit 0 2\n"; } else { - print $cfgfile "tmpfs /tmp tmpfs defaults,size=10m 0 2\n"; - print $cfgfile "tmpfs /var/tmp tmpfs defaults,size=10m 0 2\n"; + print $cfgfile "tmpfs /tmp tmpfs defaults 0 2\n"; + print $cfgfile "tmpfs /var/tmp tmpfs defaults 0 2\n"; } my $rootfs_name=$profile."_".$arch; From 834ae798ca1246d543767a10e58905b49cc033ab Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 12 Nov 2014 22:09:35 -0500 Subject: [PATCH 6/7] fix bug 4387 :sles12:mkvm failed --- xCAT-server/lib/xcat/plugins/kvm.pm | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index f5d245371..4c68e4174 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -691,7 +691,9 @@ sub build_xmldesc { } if ($hypcpumodel eq "ppc64") { my %cpuhash = (); - $cpuhash{model} = $hypcputype; + if ($hypcputype) { + $cpuhash{model} = $hypcputype; + } if ($args{cpus}) { $xtree{vcpu}->{content}=$args{cpus} * $hypcputhreads; $cpuhash{topology}->{sockets} = 1; @@ -1888,7 +1890,6 @@ sub chvm { if ($cpucount) { my $hypcpumodel = $confdata->{$confdata->{vm}->{$node}->[0]->{host}}->{cpumodel}; if ($hypcpumodel eq "ppc64") { - my $hypcputype = $confdata->{$confdata->{vm}->{$node}->[0]->{host}}->{cputype}; my $cputhreads = $parsed->findnodes("/domain/cpu/topology")->[0]->getAttribute('threads'); unless ($cputhreads) { $cputhreads = "1"; @@ -3062,17 +3063,20 @@ sub dohyp { if (exists($nodeinfo->{model})) { $confdata->{$hyp}->{cpumodel} = $nodeinfo->{model}; if ($nodeinfo->{model} eq "ppc64") { - my $syshash = XMLin($hypconn->get_sysinfo()); - my $processor_content = $syshash->{processor}->[0]->{entry}->{type}->{content}; - if ($processor_content =~ /POWER8/i) { - $confdata->{$hyp}->{cputype} = "power8"; - $confdata->{$hyp}->{cpu_thread} = "8"; - } elsif ($processor_content =~ /POWER7/i) { - $confdata->{$hyp}->{cputype} = "power7"; - $confdata->{$hyp}->{cpu_thread} = "4"; - } elsif ($processor_content =~ /POWER6/i) { - $confdata->{$hyp}->{cputype} = "power6"; - $confdata->{$hyp}->{cpu_thread} = "2"; + my $sysinfo = $hypconn->get_sysinfo(); + if ($sysinfo) { + my $syshash = XMLin($sysinfo); + my $processor_content = $syshash->{processor}->[0]->{entry}->{type}->{content}; + if ($processor_content =~ /POWER8/i) { + $confdata->{$hyp}->{cputype} = "power8"; + $confdata->{$hyp}->{cpu_thread} = "8"; + } elsif ($processor_content =~ /POWER7/i) { + $confdata->{$hyp}->{cputype} = "power7"; + $confdata->{$hyp}->{cpu_thread} = "4"; + } elsif ($processor_content =~ /POWER6/i) { + $confdata->{$hyp}->{cputype} = "power6"; + $confdata->{$hyp}->{cpu_thread} = "2"; + } } } } From df970f4cb0566d6f5dd7cd0e1bf37d0b19adbeeb Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 13 Nov 2014 03:24:33 -0500 Subject: [PATCH 7/7] defect 4384: fix the issue that copycds command cannot be ctrl+c cleanly. The root cause was INT signal was not received by the plugin process after it sends out from relay_fds. The fix is to send both INT and TERM. TERM can be received in this case. --- xCAT-server/sbin/xcatd | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 6fe1d1c1a..597ac84e1 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2410,6 +2410,7 @@ sub relay_fds { #Relays file descriptors from pipes to children to the SSL socke foreach (keys %plugin_children) { print "Sending INT to $_\n"; kill 2, $_; + kill 15, $_; } foreach my $cin ($fds->handles) { print $cin "die\n";