diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 0dab656a2..c0d38cffb 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -147,6 +147,28 @@ if ( -e "/etc/debian_version" ){ # determine whether redhat or sles $::linuxos = xCAT::Utils->osver(); +# SLES SP 1 +my $sp1flag; +# if linuxos==sles12 +if ( $::linuxos == "sles12" ){ + # open /etc/os-release + my @lines; + my $relfile; + $sp1flag = 0; + open($relfile,"<","/etc/os-release"); + # parse lines + @lines = <$relfile>; + close($relfile); + chomp(@lines); + # if == 12.1 + if (grep /VERSION_ID="12.1"/, @lines){ + #$::linuxos == "sles12.1"; + $sp1flag = 1; + } +} +# set flag +# SLES SP 1 + # is this MariaDB or MySQL $::MariaDB=0; my $cmd; @@ -202,7 +224,7 @@ if (grep(/$mysqlcheck/, @output)) #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 ){ +if ( $::debianflag or $sp1flag ){ $cmd = "pidof mysqld"; xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC == 0) @@ -950,7 +972,7 @@ sub mysqlstart { my @output = xCAT::Utils->runcmd($cmd, 0); my $mysqlcheck = "--datadir"; # see if really running - if ( $::debianflag ){ + if ( $::debianflag or $sp1flag ){ $mysqlcheck = "mysqld"; } if (grep(/$mysqlcheck/, @output))