From afe37ebeab452f288d1bdb537b0a118be3342a54 Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 19 Nov 2014 17:34:04 -0500 Subject: [PATCH 01/24] initialize rc var in Table.pm and tabutils.pm to remove warnings when running xcatd in foreground --- perl-xCAT/xCAT/Table.pm | 2 +- xCAT-server/lib/xcat/plugins/tabutils.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index bbe2ddbc8..474e4c8d0 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -3837,7 +3837,7 @@ sub writeAllEntries } my $filename = shift; my $fh; - my $rc; + my $rc = 0; # open the file for write unless (open($fh," > $filename")) { my $msg="Unable to open $filename for write \n."; diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 3001c0546..71f5cfe71 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -740,7 +740,7 @@ sub tabdump output_table($table,$cb,$tabh,$recs); } else { # dump to file - my $rc1; + my $rc1 = 0; my $fh; # check to see if you can open the file unless (open($fh," > $FILENAME")) { From 95e9cc18fb297661dc045be82f978379dd2cc017 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 19 Nov 2014 20:18:59 -0800 Subject: [PATCH 02/24] remove packages xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal in ALLBUILD --- buildcore.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildcore.sh b/buildcore.sh index 7edc5cad1..a07099f23 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -41,7 +41,8 @@ UPLOADUSER=bp-sawyers FRS=/home/frs/project/x/xc/xcat # These are the rpms that should be built for each kind of xcat build -ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack xCAT-SoftLayer xCAT-OpenStack-baremetal" +#ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack xCAT-SoftLayer xCAT-OpenStack-baremetal" +ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-SoftLayer" ZVMBUILD="perl-xCAT xCAT-server xCAT-UI" ZVMLINK="xCAT-client xCAT xCATsn" # xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat From 5d55cc5dbeeef96e7fc633843e1f86d1efee22e7 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 19 Nov 2014 20:28:18 -0800 Subject: [PATCH 03/24] add help option --- xCAT-server/share/xcat/tools/xCATreg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index 507e5e38b..7c4438184 100755 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -86,7 +86,7 @@ sub usage -U: when -U is specified, only code updates can trigger the regression.\n -V: log and message in verbose mode.\n -e: send the test result to email_addr\n"; - print " xCATreg [-?|-h]\n"; + print " xCATreg [--help|-h]\n"; print " xCATreg [-f configure file] [-b branch] [-m mangement node][-V][-e] install mn \n"; print " xCATreg [-f configure file] [-b branch] [-m mangement node ] [-U][-V][-e] if code updates there will be regression.\n"; print "\n"; @@ -1530,7 +1530,7 @@ send_msg(2,"........................"); ####################################### send_msg(2, "step 0, initializing..............."); if ( - !GetOptions("h|?" => \$needhelp, + !GetOptions("h|help" => \$needhelp, "f=s" => \$configfile, "b=s" => \$branch, "m=s" => \$management_node, From 358959724d571944e166a87de7e7461cef27dfa6 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 21 Nov 2013 14:16:20 +0800 Subject: [PATCH 04/24] fix for bug 4422: fix the ubuntu template problem with x86_64 kvm virtual machnes --- xCAT-server/share/xcat/install/ubuntu/compute.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 xCAT-server/share/xcat/install/ubuntu/compute.tmpl diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl old mode 100644 new mode 100755 index d3b3a79c8..01c1c74ac --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -53,7 +53,7 @@ d-i partman/early_command string \ rm /tmp/devs-with-boot 2>/dev/null || true; \ else \ DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o 'sd.*$'`; \ - if [[ $DEV == "" ]]; then DEV="sda"; fi; \ + if [[ "$DEV" == "" ]]; then DEV="sda"; fi; \ echo "/dev/$DEV" > /tmp/boot_disk; \ fi; \ debconf-set partman-auto/disk "$(cat /tmp/boot_disk)" From 449ee0f8086ac0e7ce120342cd4df1e78d842327 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 19 Nov 2014 03:16:44 -0500 Subject: [PATCH 05/24] correct postinstall scripts for ubuntu diskless --- .../xcat/netboot/ubuntu/compute.ubuntu14.04.1.postinstall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.1.postinstall b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.1.postinstall index a08d3f238..d2bc8eb82 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.1.postinstall +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.1.postinstall @@ -21,7 +21,7 @@ profile=$4 workdir=$5 #-- Example how /etc/fstab can be automatically generated during image generation: -#cat <$installroot/etc/fstab +cat <$installroot/etc/fstab devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 @@ -29,7 +29,7 @@ sysfs /sys sysfs defaults 0 0 tmpfs /tmp tmpfs defaults 0 2 tmpfs /var/tmp tmpfs defaults 0 2 compute_ppc64el / tmpfs rw 0 1 -#END +END #-- Uncomment the line contains "cons" in /etc/inittab From 3a4cefe53b58c4392f95617613dc4485e2c4349b Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 19 Nov 2014 07:44:17 -0500 Subject: [PATCH 06/24] defect 4336,4352: in xcatd, for aix, make all the process (fix for udp process) to be stopped when received TERM singal from stopsrc command to the main process --- xCAT-server/sbin/xcatd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 597ac84e1..25ee8462e 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -977,6 +977,15 @@ unless ($pid_UDP) { xexit(0); } close($udpbroker); + + $SIG{TERM} = $SIG{INT} = sub { + if ($pid_disco) { + kill 2, $pid_disco; + } + $SIG{ALRM} = sub { xexit 0; }; #die "Did not close out in time for 2 second grace period"; }; + alarm(2); + }; + do_udp_service(discoctl=>$discoctl,discopid=>$pid_disco); xexit(0); } From 1c0ff107897e242ff754e8a2a2994741dd5f38b6 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 19 Nov 2014 03:23:19 -0500 Subject: [PATCH 07/24] fix defect4397: sysclone analysize genesis fs name failed in rh7.0 --- xCAT-server/lib/xcat/plugins/anaconda.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 316bee41d..ce84709ee 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1879,6 +1879,7 @@ sub mksysclone } # copy kernel and initrd from image dir to /tftpboot +=pod my $kernpath; my $initrdpath; my $ramdisk_size = 200000; @@ -1889,6 +1890,14 @@ sub mksysclone and -r "$tftpdir/xcat/genesis.fs.$arch.lzma" and $initrdpath = "$tftpdir/xcat/genesis.fs.$arch.lzma" ) +=cut + my $ramdisk_size = 200000; + my $kernpath=`ls -l $tftpdir/xcat/|grep "genesis.kernel.$arch"|awk '{print \$9}'`; + chomp($kernpath); + my $initrdpath=`ls -l $tftpdir/xcat/|grep "genesis.fs.$arch"| awk '{print \$9}'`; + chomp($initrdpath); + + if($kernpath ne '' and $initrdpath ne '') { #We have a shot... my $ent = $rents{$node}->[0]; @@ -1985,10 +1994,14 @@ sub mksysclone # $kcmdline .= " "; # $kcmdline .= $addkcmd->{'addkcmdline'}; #} + my $k; my $i; - $k = "xcat/genesis.kernel.$arch"; - $i = "xcat/genesis.fs.$arch.lzma"; + #$k = "xcat/genesis.kernel.$arch"; + #$i = "xcat/genesis.fs.$arch.lzma"; + + $k = "xcat/$kernpath"; + $i = "xcat/$initrdpath"; $bptab->setNodeAttribs( $node, From 458d82a3b28a65a1c9aad7a57ea2645f9b873fa1 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 19 Nov 2014 03:32:12 -0500 Subject: [PATCH 08/24] fix defect4407: Cloned rhels7 node doesn't have IP address in rh7 --- xCAT/postscripts/configefi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/configefi b/xCAT/postscripts/configefi index 81fd70ad4..3f6b06cff 100644 --- a/xCAT/postscripts/configefi +++ b/xCAT/postscripts/configefi @@ -22,7 +22,7 @@ if [ "$arch" = "x86_64" ]; then efibootmgr -c -l \\EFI\\redhat\\grubx64.efi -L syscloneLinux boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` - sed -i 's| root=\S*| root='$boot_root'|' /boot/efi/EFI/redhat/grub.cfg + sed -i 's| root=\S*| root='$boot_root' net.ifnames=0|' /boot/efi/EFI/redhat/grub.cfg blkid -c /dev/null |grep UUID|while read str_line do @@ -129,7 +129,7 @@ elif [ "$arch" = "ppc64" ]; then dd if=/boot/grub2/grub of=/dev/sda1 bs=4096 boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` - sed -i 's| root=UUID=\S*| root='$boot_root'|' /boot/grub2/grub.cfg + sed -i 's| root=UUID=\S*| root='$boot_root' net.ifnames=0|' /boot/grub2/grub.cfg blkid -c /dev/null |grep UUID|while read str_line do From ba51617afdd608393160c288dde7aa19366b8275 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Wed, 19 Nov 2014 06:01:54 -0500 Subject: [PATCH 09/24] fix /n after uname -p --- xCAT-buildkit/bin/buildkit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 094c5e4b2..2caafaa2d 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -1163,7 +1163,7 @@ sub edit_bldkitconf my ($osbasename,$osmore) = split(/\,/, $osinfo); my ($osmajorversion,$osminorversion) = split(/\./, $osmore); my $osarch=`uname -p`; - + chomp($osarch); my $kitcomponent_basename = $kitname."_compute"; if ($debianflag==1) { From c5e82bb0fd72b1bca13bb4014e552f2fcf2f3973 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 19 Nov 2014 06:09:23 -0500 Subject: [PATCH 10/24] fix defect4414: if there is rsync service already run, sysclone rsync server start unsuccessfully. --- xCAT-server/lib/xcat/plugins/anaconda.pm | 5 +++++ xCAT-server/lib/xcat/plugins/sles.pm | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index ce84709ee..79f655f72 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2080,6 +2080,11 @@ sub mksysclone if($retcode!=0){ my $rc = xCAT::Utils->startservice("systemimager-server-rsyncd"); if ($rc != 0) { + $callback->( + {error => ["systemimager-server-rsyncd start unsuccessfully. please check if there is rsync service already run in your s +erver, if so, stop it first and try again"], + errorcode => [1]} + ); return 1; } } diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 032df544e..1cf90e08d 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1587,6 +1587,11 @@ sub mksysclone if($retcode !=0){ my $rc = xCAT::Utils->startservice("systemimager-server-rsyncd"); if ($rc != 0) { + $callback->( + {error => ["systemimager-server-rsyncd start unsuccessfully. please check if there is rsync service already run in your s +erver, if so, stop it first and try again"], + errorcode => [1]} + ); return 1; } } From 28d2110a5e10eb58ef99931b89286a6c31959274 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 19 Nov 2014 09:42:19 -0500 Subject: [PATCH 11/24] fix bug#4366 change /bin/sh to /bin/bash --- xCAT/postscripts/addsiteyum | 2 +- xCAT/postscripts/chef-client | 2 +- xCAT/postscripts/config_chef_client | 2 +- xCAT/postscripts/config_chef_server | 2 +- xCAT/postscripts/config_chef_workstation | 2 +- xCAT/postscripts/config_puppet_client | 2 +- xCAT/postscripts/config_puppet_server | 2 +- xCAT/postscripts/configib | 2 +- xCAT/postscripts/install_chef_client | 2 +- xCAT/postscripts/install_chef_server | 2 +- xCAT/postscripts/install_chef_workstation | 2 +- xCAT/postscripts/install_puppet_client | 2 +- xCAT/postscripts/install_puppet_server | 2 +- xCAT/postscripts/ospkgs | 2 +- xCAT/postscripts/otherpkgs | 2 +- xCAT/postscripts/remoteshell | 2 +- xCAT/postscripts/setbootfromdisk | 2 +- xCAT/postscripts/setupesx | 2 +- xCAT/postscripts/setupntp | 2 +- xCAT/postscripts/setupscratch | 2 +- xCAT/postscripts/sudoer | 2 +- xCAT/postscripts/syslog | 2 +- xCAT/postscripts/xcatclient | 2 +- xCAT/postscripts/xcatinstallpost | 2 +- xCAT/postscripts/xcatserver | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/xCAT/postscripts/addsiteyum b/xCAT/postscripts/addsiteyum index 9e980dcb3..c8b5fb1ed 100755 --- a/xCAT/postscripts/addsiteyum +++ b/xCAT/postscripts/addsiteyum @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash cd `dirname $0` if [ ! -d repos/$OSVER/$ARCH ]; then logger -t xcat -p local4.err "addsiteyum: repos/$OSVER/$ARCH is not a directory" diff --git a/xCAT/postscripts/chef-client b/xCAT/postscripts/chef-client index 834b78f3f..8485aa837 100755 --- a/xCAT/postscripts/chef-client +++ b/xCAT/postscripts/chef-client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #This script will invoke the config_chef_client directly. #If the chef-server and chef-client are installed successfully at first, diff --git a/xCAT/postscripts/config_chef_client b/xCAT/postscripts/config_chef_client index 4d06eca7f..60dacd811 100755 --- a/xCAT/postscripts/config_chef_client +++ b/xCAT/postscripts/config_chef_client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/config_chef_server b/xCAT/postscripts/config_chef_server index 538c737f4..d3abdc077 100755 --- a/xCAT/postscripts/config_chef_server +++ b/xCAT/postscripts/config_chef_server @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/config_chef_workstation b/xCAT/postscripts/config_chef_workstation index 885fb3f0d..0bb826af8 100755 --- a/xCAT/postscripts/config_chef_workstation +++ b/xCAT/postscripts/config_chef_workstation @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/config_puppet_client b/xCAT/postscripts/config_puppet_client index 3bea76930..5442f2e98 100755 --- a/xCAT/postscripts/config_puppet_client +++ b/xCAT/postscripts/config_puppet_client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/config_puppet_server b/xCAT/postscripts/config_puppet_server index fff6373c4..d0e01fd7e 100755 --- a/xCAT/postscripts/config_puppet_server +++ b/xCAT/postscripts/config_puppet_server @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 3637cfb25..2cfebb470 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html # Internal script used by confignics only # xCAT post script for configuring ib adapters. diff --git a/xCAT/postscripts/install_chef_client b/xCAT/postscripts/install_chef_client index 69e799e39..ad6342b79 100755 --- a/xCAT/postscripts/install_chef_client +++ b/xCAT/postscripts/install_chef_client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html ##################################################### #=head1 install_chef_client diff --git a/xCAT/postscripts/install_chef_server b/xCAT/postscripts/install_chef_server index 7af79efa4..8ccaa87fd 100755 --- a/xCAT/postscripts/install_chef_server +++ b/xCAT/postscripts/install_chef_server @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html ##################################################### #=head1 install_chef_server diff --git a/xCAT/postscripts/install_chef_workstation b/xCAT/postscripts/install_chef_workstation index 8823ebe19..38098613a 100755 --- a/xCAT/postscripts/install_chef_workstation +++ b/xCAT/postscripts/install_chef_workstation @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html ##################################################### #=head1 install_chef_client diff --git a/xCAT/postscripts/install_puppet_client b/xCAT/postscripts/install_puppet_client index be30f15f7..24baca49b 100755 --- a/xCAT/postscripts/install_puppet_client +++ b/xCAT/postscripts/install_puppet_client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/install_puppet_server b/xCAT/postscripts/install_puppet_server index 8c399ebb4..086797a6d 100755 --- a/xCAT/postscripts/install_puppet_server +++ b/xCAT/postscripts/install_puppet_server @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index 2b1fc480d..c3c0e8c91 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html #------------------------------------------------------------------------------- diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index d851b493c..69099a94f 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html #------------------------------------------------------------------------------- diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 0157d3584..b5778c9df 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html #(C)IBM Corp # This script adds xCAT specific setup to the /etc/ssh/sshd_config and ssh_config file diff --git a/xCAT/postscripts/setbootfromdisk b/xCAT/postscripts/setbootfromdisk index 13b45c94f..251f0608c 100755 --- a/xCAT/postscripts/setbootfromdisk +++ b/xCAT/postscripts/setbootfromdisk @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html #(C)IBM Corp diff --git a/xCAT/postscripts/setupesx b/xCAT/postscripts/setupesx index 40fe21f54..ed785c2ff 100755 --- a/xCAT/postscripts/setupesx +++ b/xCAT/postscripts/setupesx @@ -47,7 +47,7 @@ fi # create a script that will launch the first time ESX does and configure # the network cat >/tmp/esxcfg.sh < Date: Thu, 20 Nov 2014 02:00:45 -0500 Subject: [PATCH 12/24] fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2b41a05cd..678b7e006 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -64,6 +64,7 @@ my $permission; # the permission works only for statelite mode currently my $tempfile; my $prompt; my $noupdate; +my $kernelimage; sub xdie { @@ -315,6 +316,9 @@ unless ($onlyinitrd) { } push @npa, $kernelname; } + elsif ($p =~ /linux-image-generic/) { + $kernelimage = "linux-image-generic"; + } elsif ($p =~ /^@/) { push @npa, "\"$p\""; } @@ -471,6 +475,13 @@ unless ($onlyinitrd) { #my $aptgetcmd_update = $yumcmd_base . " upgrade "; my $aptgetcmd_update = $aptgetcmd . "&&". $aptgetcmdby . " upgrade "; $rc = system("$aptgetcmd_update"); + if ($kernelimage) { + if ($kernelver) { + $kernelimage = "linux-image-".$kernelver."-generic"; + } + my $aptgetcmd_install = $aptgetcmd . "&&". $aptgetcmdby. " install --no-install-recommends ".$kernelimage; + $rc = system("$aptgetcmd_install"); + } print("Umount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n"); umount_chroot($rootimg_dir); # ignore any return code From 900963b1db7430d850ba5f6823557f127fe58296 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 20 Nov 2014 07:08:36 -0500 Subject: [PATCH 13/24] defect 4375: fix the xcatd which has issue to receive request from xcatd which is longer than about 160,000 bytes --- xCAT-server/sbin/xcatd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 25ee8462e..2dbb8fed8 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2157,7 +2157,7 @@ sub get_request { my $encode = shift; my $request = shift; if ($encode eq "xml") { - my $line = ""; + my $line = $request; while ((!$request) || ($request !~ m/<\/xcatrequest>/)) { my $flags=fcntl($sock,F_GETFL,0); $flags |= O_NONBLOCK; #we want sysread to bail on us, select seems to be evil to us still.. @@ -2171,7 +2171,7 @@ sub get_request { $flags=fcntl($sock,F_GETFL,0); $flags &= ~O_NONBLOCK; #now we want *print* to be blocking IO fcntl($sock,F_SETFL,$flags); - $request .= $line; + $request = $line; } return eval { XMLin($request, SuppressEmpty=>undef,ForceArray=>1) }; } elsif ($encode eq "storable") { From 029e6d18ca09c46140c4eae104447797f59579e5 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 20 Nov 2014 07:14:50 -0500 Subject: [PATCH 14/24] defect 4419: change the db notification runs in DB process instead of fork a new one since the fork new process will cause DBI connection gets into confusing --- perl-xCAT/xCAT/NotifHandler.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/NotifHandler.pm b/perl-xCAT/xCAT/NotifHandler.pm index c23db6325..c70b73942 100644 --- a/perl-xCAT/xCAT/NotifHandler.pm +++ b/perl-xCAT/xCAT/NotifHandler.pm @@ -311,9 +311,6 @@ sub notify { my ($modname, $path, $suffix) = fileparse($_, ".pm"); # print "modname=$modname, path=$path, suffix=$suffix\n"; if ($suffix =~ /.pm/) { #it is a perl module - my $pid; - if ($pid=xCAT::Utils->xfork()) { } - elsif (defined($pid)) { my $fname; if (($path eq "") || ($path eq ".\/")) { #default path is /opt/xcat/lib/perl/xCAT_monitoring/ if there is no path specified @@ -328,8 +325,7 @@ sub notify { else { ${"xCAT_monitoring::".$modname."::"}{processTableChanges}->($action, $tablename, $old_data, $new_data); } - exit 0; - } + return 0; } else { #it is a command my $pid; From 037ed0bcfd15aba247e44e2ff7052551c5fd8453 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Thu, 20 Nov 2014 02:55:23 -0500 Subject: [PATCH 15/24] fix bug 4411: Typo in the command genimage output, "geniamge" -> "genimage" --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 678b7e006..2a982d98b 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -212,7 +212,7 @@ unless ($onlyinitrd) { if ($kernelver) { find(\&isaptdir, <$kerneldir/>); if (!grep /$kerneldir/, @aptdirs) { - print "The repository for $kerneldir should be created before running the geniamge. Try to run [createrepo $kerneldir].\n"; + print "The repository for $kerneldir should be created before running the genimage.\n"; } } unless (scalar(@aptdirs)) { From b9f206c74627c115106ee40ccd83b3252050a501 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 20 Nov 2014 01:30:10 -0800 Subject: [PATCH 16/24] remove xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal --- build-ubunturepo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-ubunturepo b/build-ubunturepo index fea44509b..a2bb046e3 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -194,7 +194,8 @@ then if [ ! -d ../../$package_dir_name ];then mkdir -p "../../$package_dir_name" fi - packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack xCAT-OpenStack-baremetal xCAT-buildkit" + #packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack xCAT-OpenStack-baremetal xCAT-buildkit" + packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit" target_archs=(amd64 ppc64el) for file in `echo $packages` do From 72c058edc9571ec5eea0de0f20cc3f0cbb69760b Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 20 Nov 2014 01:57:27 -0800 Subject: [PATCH 17/24] enhance the script to support various bootmgr --- xCAT/postscripts/disableconsistentNICrename | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/disableconsistentNICrename b/xCAT/postscripts/disableconsistentNICrename index 3c5e221b0..90f33c039 100755 --- a/xCAT/postscripts/disableconsistentNICrename +++ b/xCAT/postscripts/disableconsistentNICrename @@ -2,4 +2,15 @@ #modify the grub.cfg to prevent nic consistent network renameing grep -E -q "net.ifnames=0" /etc/sysconfig/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/sysconfig/grub grep -E -q "net.ifnames=0" /etc/default/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/default/grub -grub2-mkconfig -o /boot/grub2/grub.cfg + +if [ -f "/boot/efi/EFI/redhat/grub.cfg" ];then + GRUB_CFG_FILE="/boot/efi/EFI/redhat/grub.cfg" +#elif [ -f "/boot/efi/efi/SuSE/elilo.efi" ];then +elif [ -f "/boot/grub2/grub.cfg" ];then + GRUB_CFG_FILE="/boot/grub2/grub.cfg" +elif [ -f "/boot/grub/grub.cfg" ];then + GRUB_CFG_FILE="/boot/grub/grub.cfg" +fi + + +grub2-mkconfig -o "$GRUB_CFG_FILE" From 3f59552d0c5d7cb73de7b576beca574998227728 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 21 Nov 2014 00:19:37 -0800 Subject: [PATCH 18/24] fix defect #4307 [FVT]:chdef newimage -u give out wrong arch in ubuntu; fix defect #4345 Utils->osver routine does not support Redhat7 or SLES12;fix defect #4308 [FVT]: osarch default value of user defined osimage is ppc64le. needs to change to ppc64el --- perl-xCAT/xCAT/Utils.pm | 71 +++++++++++++++++++- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 22 ++++-- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 5f37479b4..8eb1e0050 100755 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2162,7 +2162,72 @@ sub osver my $line = ''; my @lines; my $relfile; - if (-f "/etc/redhat-release") + + if (-f "/etc/os-release"){ + my $version; + my $version_id; + my $id; + my $id_like; + my $name; + my $prettyname; + my $verrel; + if (open($relfile,"<","/etc/os-release")) { + my @text = <$relfile>; + close($relfile); + chomp(@text); + #print Dumper(\@text); + foreach my $line (@text){ + if($line =~ /^\s*VERSION=\"?([0-9\.]+).*/){ + $version=$1; + } + if($line =~ /^\s*VERSION_ID=\"?([0-9\.]+).*/){ + $version_id=$1; + } + + + if($line =~ /^\s*ID=\"?([0-9a-z\_\-\.]+).*/){ + $id=$1; + } + if($line =~ /^\s*ID_LIKE=\"?([0-9a-z\_\-\.]+).*/){ + $id_like=$1; + } + + + if($line =~ /^\s*NAME=\"?(.*)/){ + $name=$1; + } + if($line =~ /^\s*PRETTY_NAME=\"?(.*)/){ + $prettyname=$1; + } + } + } + + $os=$id; + if (!$os and $id_like) { + $os=$id_like; + } + + $verrel=$version; + if (!$verrel and $version_id) { + $verrel=$version_id; + } + + + if(!$name and $prettyname){ + $name=$prettyname; + } + + if($os =~ /rhel/ and $name =~ /Server/i){ + $os="rhels"; + } + + if($verrel =~ /([0-9]+)\.?(.*)/) { + $ver=$1; + $rel=$2; + } +# print "$ver -- $rel"; + } + elsif (-f "/etc/redhat-release") { open($relfile,"<","/etc/redhat-release"); $line = <$relfile>; @@ -2269,8 +2334,10 @@ sub osver close($relfile); } } +#print "xxxx $type === $rel \n"; if ( $type and $type =~ /all/ ) { - if ( $rel ) { + if ( $rel ne "") { +# print "xxx $os-$ver-$rel \n"; return( "$os" . "," . "$ver" . ".$rel" ); } else { return( "$os" . "," . "$ver" ); diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index e61152906..2323d469d 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -192,6 +192,14 @@ sub parse_attr_for_osimage{ return -1; } my ($tmp_imagetype, $tmp_arch, $tmp_osname,$tmp_ostype,$tmp_osvers); + if (!exists($attr_hash->{osvers})) { + $tmp_osvers = xCAT::Utils->osver("all"); + $tmp_osvers =~ s/,//; + $attr_hash->{osvers} = $tmp_osvers; + } else { + $tmp_osvers =$attr_hash->{osvers}; + } + if (!exists($attr_hash->{osarch})) { $tmp_arch = `uname -m`; chomp($tmp_arch); @@ -200,13 +208,13 @@ sub parse_attr_for_osimage{ } else { $tmp_arch = $attr_hash->{osarch}; } - if (!exists($attr_hash->{osvers})) { - $tmp_osvers = xCAT::Utils->osver("all"); - $tmp_osvers =~ s/,//; - $attr_hash->{osvers} = $tmp_osvers; - } else { - $tmp_osvers =$attr_hash->{osvers}; - } + + #for ubuntu,the the arch attribute "ppc64le" should be modified to "ppc64el" + if(($tmp_osvers =~ /^ubuntu/i) && ($tmp_arch =~ /^ppc64le/i)){ + $tmp_arch="ppc64el"; + $attr_hash->{osarch} = "ppc64el"; + } + $tmp_osname = $tmp_osvers; $tmp_ostype="Linux"; #like Linux, Windows $tmp_imagetype="linux"; From c65b55b79de70ebd2a05d74650723ca148270145 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 21 Nov 2014 02:24:36 -0500 Subject: [PATCH 19/24] fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el with kernelver attribute --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2a982d98b..8ae54c759 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -477,7 +477,7 @@ unless ($onlyinitrd) { $rc = system("$aptgetcmd_update"); if ($kernelimage) { if ($kernelver) { - $kernelimage = "linux-image-".$kernelver."-generic"; + $kernelimage = "linux-image-".$kernelver; } my $aptgetcmd_install = $aptgetcmd . "&&". $aptgetcmdby. " install --no-install-recommends ".$kernelimage; $rc = system("$aptgetcmd_install"); From c264c8b3a8ea964982938ae6459c3517e4bf965f Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 21 Nov 2014 02:37:40 -0500 Subject: [PATCH 20/24] fix bug 4424: Failed to genimage for Ubuntu 14.10 diskless node on ppc64el --- xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist index c23ba181a..617097381 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist @@ -2,7 +2,7 @@ bash nfs-common openssl isc-dhcp-client -linux-image-server +linux-image-generic openssh-server openssh-client wget From e14dc92c125de0892e703f17d092ec465656a5eb Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 21 Nov 2014 02:50:51 -0500 Subject: [PATCH 21/24] fix bug 4415: Ubuntu 14.10 diskfull installation failed on IBM PowerKVM guest --- .../share/xcat/install/ubuntu/compute.tmpl | 0 .../share/xcat/install/ubuntu/kvm.tmpl | 23 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) mode change 100755 => 100644 xCAT-server/share/xcat/install/ubuntu/compute.tmpl diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl old mode 100755 new mode 100644 diff --git a/xCAT-server/share/xcat/install/ubuntu/kvm.tmpl b/xCAT-server/share/xcat/install/ubuntu/kvm.tmpl index 1f7fa6e21..01c1c74ac 100644 --- a/xCAT-server/share/xcat/install/ubuntu/kvm.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/kvm.tmpl @@ -18,7 +18,7 @@ d-i netcfg/dhcp_timeout string 120 d-i mirror/country string manual d-i mirror/protocol string http -d-i mirror/http/directory string /install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch# +d-i mirror/http/directory string #INCLUDE_OSIMAGE_PKGDIR# d-i mirror/http/proxy string # Suite to install. @@ -37,7 +37,26 @@ d-i partman-md/device_remove_md boolean true #create the /tmp/partitioning based on the uefi or legacy bios d-i partman/early_command string \ - debconf-set partman-auto/disk "$(list-devices disk | head -n1)" + set -x; \ + rm /tmp/devs-with-boot 2>/dev/null || true; \ + for d in $(list-devices partition); do \ + mkdir -p /tmp/mymount; \ + rc=0; \ + mount $d /tmp/mymount || rc=$?; \ + if [[ $rc -eq 0 ]]; then \ + [[ -d /tmp/mymount/boot ]] && echo $d >>/tmp/devs-with-boot; \ + umount /tmp/mymount; \ + fi \ + done; \ + if [[ -e /tmp/devs-with-boot ]]; then \ + head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/boot_disk; \ + rm /tmp/devs-with-boot 2>/dev/null || true; \ + else \ + DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o 'sd.*$'`; \ + if [[ "$DEV" == "" ]]; then DEV="sda"; fi; \ + echo "/dev/$DEV" > /tmp/boot_disk; \ + fi; \ + debconf-set partman-auto/disk "$(cat /tmp/boot_disk)" d-i partman-auto/expert_recipe_file string /tmp/partitioning # This makes partman automatically partition without confirmation, provided From cb620093067957925198ebbedd11d1646a3bbb95 Mon Sep 17 00:00:00 2001 From: huweihua Date: Fri, 21 Nov 2014 06:51:20 -0500 Subject: [PATCH 22/24] fix defect4393: confignics --ibport 2 Cannot find device ib0 on diskless node although ib drivers is installed --- .../ib/scripts/Mellanox/mlnxofed_ib_install | 50 +++++++++++++++++-- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index 62039922e..6ae065f70 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # # # Sample script to customize options for Mellonax OFED IB support @@ -143,8 +143,8 @@ deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sour cat /etc/os-release|grep NAME|grep Ubuntu>/dev/null && uname -m |grep ppc64 >/dev/null then - echo "ARCH=powerpc perl -x mlnxofedinstall $mlnxofed_options" - ARCH=powerpc perl -x mlnxofedinstall --without-fw-update $mlnxofed_options + echo "ARCH=powerpc perl -x mlnxofedinstall --without-fw-update $mlnxofed_options" + ARCH=powerpc perl -x mlnxofedinstall --without-fw-update $mlnxofed_options sleep 1 service openibd restart else @@ -211,10 +211,50 @@ deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> $sourceslist mount --bind /dev $installroot/dev/ mount --bind /proc $installroot/proc/ mount --bind /sys $installroot/sys/ - chroot $installroot apt-get install -y linux-headers-$(uname -r) - echo "perl -x mlnxofedinstall $mlnxofed_options" + mv "${installroot}/bin/uname" "${installroot}/bin/uname.nouse" +# cat <<-EOF >"${installroot}/bin/uname" +# #!/bin/sh +# [ "\$1" = "-r" ] && cd /lib/modules && for d in *; do :; done && echo \$d +# [ "\$1" = "-m" ] && if [ -d "/proc/powerpc" ];then echo ppc64le;else echo x86_64;fi +# [ "\$1" = "-s" ] && echo Linux +# exit 0 +# EOF + + cat <<-EOF >"${installroot}/bin/uname" + #!/bin/sh + case "\$1" in + "-m") + ARCH="\$(dpkg --print-architecture || rpm -q kernel-\$("\$0" -r) --qf '%{arch}')" + case "\$ARCH" in + "amd64") + ARCH="x86_64" + ;; + "ppc64el") + ARCH="ppc64le" + ;; + esac + echo "\$ARCH" + ;; + "-r") + cd /lib/modules && for d in * ; do : ; done && echo \$d + ;; + "-s"|"") + echo "Linux" + ;; + esac + exit 0 + EOF + +# head -n 999 "${installroot}/bin/uname" + chmod 0755 "${installroot}/bin/uname" + + chroot $installroot sh -c 'apt-get install -y linux-headers-$(uname -r)' + + echo "perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options" chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options + mv "${installroot}/bin/uname.nouse" "${installroot}/bin/uname" + rm -rf $installroot/tmp/ofed_install umount $installroot/dev/ umount $installroot/proc/ From 69bf4249be98d1344cb26f1cb64b195ab4c02c0c Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Sat, 22 Nov 2014 21:24:28 -0500 Subject: [PATCH 23/24] Bug#4385 mysqlsetup does not support mariaDB in Ubuntu --- xCAT-client/bin/mysqlsetup | 71 +++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 0947a4688..4da94aab2 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -147,29 +147,41 @@ if ( -e "/etc/debian_version" ){ # determine whether redhat or sles $::linuxos = xCAT::Utils->osver(); -# -# check to see if mysql is installed - # -my $cmd = "rpm -qa | grep -i perl-DBD-mysql"; -if ( $::debianflag ){ - $cmd = "dpkg -l | grep mysql-server"; -} -xCAT::Utils->runcmd($cmd, 0); -if ($::RUNCMD_RC != 0) -{ - my $message = - "\nMySQL perl DBD is not installed. If on AIX, it should be first obtained from the xcat dependency tarballs and installed before running this command.\n If on Linux, install from the OS CDs."; - xCAT::MsgUtils->message("E", " $cmd failed. $message"); - exit(1); -} # is this MariaDB or MySQL $::MariaDB=0; -$cmd = "rpm -qa | grep -i mariadb"; # check this is MariaDB not MySQL +my $cmd; +if ( $::debianflag ){ + $cmd = "dpkg -l | grep mariadb"; +} else { + $cmd = "rpm -qa | grep -i mariadb"; # check this is MariaDB not MySQL +} xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC == 0) { $::MariaDB=1; } +# +# check to see if mysql is installed + # +$cmd = "rpm -qa | grep -i perl-DBD-mysql"; +my $msg = "\nMySQL perl DBD "; +if ( $::debianflag ){ + if ( $::MariaDB ){ + $cmd = "dpkg -l | grep -i mariadb-server"; + $msg = "\nmariadb-server "; + } else { + $cmd = "dpkg -l | grep mysql-server"; + $msg = "\nmysql-server "; + } +} +xCAT::Utils->runcmd($cmd, 0); +if ($::RUNCMD_RC != 0) +{ + my $message = + "\n$msg is not installed. If on AIX, it should be first obtained from the xcat dependency tarballs and installed before running this command.\n If on Linux, install from the OS CDs."; + xCAT::MsgUtils->message("E", " $cmd failed. $message"); + exit(1); +} # check to see if MySQL is running $::mysqlrunning = 0; $::xcatrunningmysql = 0; @@ -187,6 +199,29 @@ if (grep(/$mysqlcheck/, @output)) } $::mysqlrunning = 1; } + +#for ubuntu 14, after install mysql/maria server, the mysql will running +#need to stop mysql in order to setup init xcat mysql +if ( $::debianflag ){ + $cmd = "pidof mysqld"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC == 0) + { + if ($::INIT) + { + my $ret=xCAT::Utils->stopservice("mysql"); + if ($ret != 0) + { + xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); + exit(1); + } + } + else { + $::mysqlrunning = 1; + } + } + +} if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql { # cfgloc exists $cmd = "fgrep mysql /etc/xcat/cfgloc"; @@ -1000,6 +1035,10 @@ sub mysqlreboot $cmd = "chkconfig mariadb on"; } else { #sles $cmd = "chkconfig mysql on"; + if ( $::debianflag ){ + $cmd = "update-rc.d mysql defaults"; + } + } } else { # mysql if ($::linuxos =~ /rh.*/) From 9d0b4b1be73c2783cc1a85a524cf866501d46f76 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 24 Nov 2014 09:41:43 -0500 Subject: [PATCH 24/24] 4390: In DB Access process, recover the signal handle in %SIG which was cleaned up by accident. This fix should be removed if fixed the root cause of %SIG clean up. --- perl-xCAT/xCAT/Table.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 474e4c8d0..706c08e77 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -179,6 +179,10 @@ sub init_dbworker { #setup signal in NotifHandler so that the cache can be updated xCAT::NotifHandler::setup($$, 0); + # NOTE: There's a bug that sometimes the %SIG is cleaned up by accident, but we cannot figure out when and why + # this happens. The temporary fix is to backup the %SIG and recover it when necessary. + my %SIGbakup = %SIG; + while (not $exitdbthread) { eval { my @ready_socks = $clientset->can_read; @@ -191,6 +195,7 @@ sub init_dbworker { } else { eval { handle_dbc_conn($currcon,$clientset); + unless (%SIG && defined ($SIG{USR1})) { %SIG = %SIGbakup; } }; if ($@) { my $err=$@;