1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00
This commit is contained in:
David Hill
2016-12-02 00:08:01 +00:00
parent aac6fd6485
commit 4efd58d23d
3 changed files with 16 additions and 70 deletions

View File

@@ -11,14 +11,21 @@ checkForError() {
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
if test -f $HOME/.my.cnf ; then
password=`cat $HOME/.my.cnf | grep password | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
if [ ! -z $password ]; then
pwprompt="-p$password"
return 1;
else
echo "MySQL Password file missing or incorrect, check .my.cnf file"
rm -f /tmp/error.check
$installdir/mysql/mysql-Columnstore stop
sleep 2
exit 1;
exit 2;
fi
else
echo "MySQL Password file missing or incorrect, check .my.cnf file"
rm -f /tmp/error.check
$installdir/mysql/mysql-Columnstore stop
sleep 2
exit 2;
fi
fi
@@ -60,7 +67,9 @@ for arg in "$@"; do
rpmmode="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
password="$(echo $arg | awk -F= '{print $2}')"
if [ ! -z $password ]; then
pwprompt="-p$password"
fi
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
installdir="$(echo $arg | awk -F= '{print $2}')"
prefix=$(dirname $installdir)
@@ -118,7 +127,7 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
$installdir/mysql/mysql-Columnstore stop
sleep 2
exit 1;
exit 2;
fi
fi

View File

@@ -259,70 +259,6 @@ void mysqlSetup()
HOME = p;
}
//check for password set
//start in the same way that mysqld will be started normally.
try {
oam.actionMysqlCalpont(MYSQL_START);
}
catch(const std::exception &exc)
{
std::cerr << exc.what() << std::endl;
}
sleep(2);
for (;;)
{
// check if mysql is supported and get info
string calpontMysql = installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root ";
string cmd = calpontMysql + pwprompt + " -e 'status' > /tmp/idbmysql.log 2>&1";
system(cmd.c_str());
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") ) {
//check and get password
string mysqlpw = oam::UnassignedName;
try {
mysqlpw = oam.getMySQLPassword(false);
cout << "NOTE: Using MariaDB Columnstore password from " + HOME + "/.my.cnf" << endl;
}
catch (...)
{
cout << endl << "MariDB Columnstore login failure, password is assigned. Need MariaDB Columnstore password configuration file " + HOME + "/.my.cnf on local module" << endl;
exit(1);
}
mysqlpw = "'" + mysqlpw + "'";
pwprompt = "--password=" + mysqlpw;
try {
oam.setSystemConfig("MySQLPasswordConfig", "y");
}
catch(const std::exception &exc)
{
std::cerr << exc.what() << std::endl;
}
}
else
{
if (!oam.checkLogStatus("/tmp/idbmysql.log", "Columnstore") ) {
cout << endl << "ERROR: MariaDB Columnstore runtime error, exit..." << endl << endl;
system("cat /tmp/idbmysql.log");
exit (1);
}
else
{
try {
oam.actionMysqlCalpont(MYSQL_STOP);
}
catch(const std::exception &exc)
{
std::cerr << exc.what() << std::endl;
}
unlink("/tmp/idbmysql.log");
break;
}
}
}
cmd = installDir + "/bin/post-mysql-install " + pwprompt + " --installdir=" + installDir + " > /tmp/post-mysql-install.log";;
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) == 2) {

View File

@@ -3018,7 +3018,8 @@ int main(int argc, char *argv[])
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "bin/getMySQLpw > /tmp/mysqlpw.log 2>&1";
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << endl << "MariaDB Columnstore login failure, password is assigned. Need MariaDB Columnstore password configuration file " + HOME + "/.my.cnf on " << remoteModuleName << endl;
cout << endl << "MariaDB Columnstore login failure, MySQL Root password is set." << endl;
cout << "Need MariaDB Columnstore password configuration file " + HOME + "/.my.cnf on " << remoteModuleName << endl;
exit(1);
}