From 63ebc1497b555cb1c2adff93d8f291548a6702b2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 14:07:29 -0400 Subject: [PATCH 1/3] Extract full version information --- xCAT-client/bin/mysqlsetup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 0b8f87ee41..f3449ea6b2 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -146,7 +146,8 @@ if (-e "/etc/debian_version") { } # determine whether redhat or sles -$::linuxos = xCAT::Utils->osver(); +$::linuxos = xCAT::Utils->osver("all"); # returns "name,version.release" +$::linuxos =~ tr/,//d; # remove comma separating release name and version numbers # is this MariaDB or MySQL $::MariaDB = 0; From 934b66df9148749a082b5c78678120979955dda8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 14:30:36 -0400 Subject: [PATCH 2/3] Use non-interactive flag when calling zypper install --- xCAT-test/autotest/testcase/migration/sles_migration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a0afec2a57..f11c556620 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -45,7 +45,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION1_DEP" check:rc==0 @@ -164,7 +164,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION2_CORE" check:rc==0 From d8bb3ea2db7dacdc5f91e2f11a7ee569d7c25c30 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 19 May 2021 15:30:49 -0400 Subject: [PATCH 3/3] Link file for all OSes --- xCAT-client/bin/mysqlsetup | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index f3449ea6b2..3d0cd6fcf6 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -146,8 +146,7 @@ if (-e "/etc/debian_version") { } # determine whether redhat or sles -$::linuxos = xCAT::Utils->osver("all"); # returns "name,version.release" -$::linuxos =~ tr/,//d; # remove comma separating release name and version numbers +$::linuxos = xCAT::Utils->osver(); # is this MariaDB or MySQL $::MariaDB = 0; @@ -901,14 +900,12 @@ sub initmysqldb } $cmd = "$sqlcmd --user=mysql"; - #on rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip, - #but it's available at the /usr/bin/resolveip - if ($::linuxos eq "rhels7.7") { - my $resolveip="/usr/libexec/resolveip"; - if (!(-x ($resolveip))) { - my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; - xCAT::Utils->runcmd($linkcmd, 0); - } + # On rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip + # Link it to /usr/bin/resolveip for all OSes, just in case some future releases have the same requirement + my $resolveip="/usr/libexec/resolveip"; + if (!(-x ($resolveip))) { + my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; + xCAT::Utils->runcmd($linkcmd, 0); } } xCAT::Utils->runcmd($cmd, 0);