1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Revert "when setting systemName also modify my.cnf to update server_audit_sys…"

This commit is contained in:
benthompson15
2017-04-17 11:56:27 -05:00
committed by GitHub
parent 99ffc8430a
commit f803b94eb6
3 changed files with 12 additions and 35 deletions

View File

@ -8336,7 +8336,7 @@ namespace oam
/******************************************************************************************
* @brief changeMyCnf
*
* purpose: change my.cnf and add if value is not present
* purpose: change my.cnf
*
******************************************************************************************/
bool Oam::changeMyCnf( std::string paramater, std::string value )
@ -8351,39 +8351,24 @@ namespace oam
vector <string> lines;
char line[200];
string buf;
bool foundIt = false;
while (file.getline(line, 200))
{
buf = line;
// change port
if ( paramater == "port" )
{
string::size_type pos = buf.find(paramater,0);
if ( pos == 0 ) {
string::size_type pos = buf.find("=",0);
if ( pos != string::npos )
buf = paramater + " = " + value;
foundIt = true;
buf = "port = " + value;
}
}
//output to temp file
lines.push_back(buf);
}
if (!foundIt)
{
// Back to beginning of file
file.clear();
file.seekg(0, ios::beg);
lines.clear();
while (file.getline(line, 200))
{
buf = line;
string::size_type pos = buf.find("[mysqld]",0);
if ( pos != string::npos ) {
lines.push_back(buf);
buf = paramater + " = " + value;
}
//output to temp file
lines.push_back(buf);
}
}
file.close();
unlink (mycnfFile.c_str());
ofstream newFile (mycnfFile.c_str());

View File

@ -4858,7 +4858,6 @@ bool storageSetup(bool amazonInstall)
void setSystemName()
{
Oam oam;
//setup System Name
try {
systemName = sysConfig->getConfig(SystemSection, "SystemName");
@ -4881,7 +4880,6 @@ void setSystemName()
try {
sysConfig->setConfig(SystemSection, "SystemName", systemName);
oam.changeMyCnf( "server_audit_syslog_info", systemName );
}
catch(...)
{

View File

@ -129,13 +129,7 @@ int main(int argc, char** argv)
if (xflg)
cf->delConfig(argv[optind + 0], argv[optind + 1]);
else
{
cf->setConfig(argv[optind + 0], argv[optind + 1], argv[optind + 2]);
if (strcmp(argv[optind + 1],"SystemName") == 0)
{
oam.changeMyCnf( "server_audit_syslog_info", argv[optind + 2] );
}
}
cf->write();
if (dflg || serverInstallType == oam::INSTALL_COMBINE_DM_UM_PM)