1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
This commit is contained in:
David Hill
2018-09-19 14:26:21 -05:00
parent c8839b7daa
commit f417d8cfd3
2 changed files with 20 additions and 79 deletions

View File

@ -344,6 +344,7 @@ int main(int argc, char** argv)
// sleep (1);
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1";
system(cmd.c_str());
}
@ -437,7 +438,7 @@ int main(int argc, char** argv)
}
catch (...)
{
log.writeLog(__LINE__, "wating for good return from getModuleStatus", LOG_TYPE_DEBUG);
log.writeLog(__LINE__, "waiting for good return from getModuleStatus", LOG_TYPE_DEBUG);
sleep (1);
}
}
@ -553,6 +554,7 @@ int main(int argc, char** argv)
if ( retry == 20 )
{
log.writeLog(__LINE__, "Check DB mounts failed, shutting down", LOG_TYPE_CRITICAL);
//Set the alarm
// aMonitor.sendAlarm(config.moduleName().c_str(), STARTUP_DIAGNOTICS_FAILURE, SET);
// sleep (1);
@ -582,7 +584,7 @@ int main(int argc, char** argv)
while (!mainResumeFlag)
{
log.writeLog(__LINE__, "WATING FOR mainResumeFlag to be set", LOG_TYPE_DEBUG);
log.writeLog(__LINE__, "WAITING FOR mainResumeFlag to be set", LOG_TYPE_DEBUG);
sleep(1);
}
@ -1131,9 +1133,6 @@ static void messageThread(MonitorConfig config)
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
system(cmd.c_str());
for (;;)
@ -2363,9 +2362,6 @@ static void statusControlThread()
string port = sysConfig->getConfig(portName, "Port");
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
system(cmd.c_str());
}
catch (...)

View File

@ -1064,6 +1064,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
log.writeLog(__LINE__, "MSG RECEIVED: Start All process request...");
//start the mysqld daemon
try
{
oam.actionMysqlCalpont(MYSQL_START);
@ -1762,20 +1763,10 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
if (!oam.checkLogStatus("/tmp/umount.txt", "busy"))
break;
if ( rootUser)
{
cmd = "lsof " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
system(cmd.c_str());
cmd = "fuser -muvf " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
system(cmd.c_str());
}
else
{
cmd = "sudo lsof " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
system(cmd.c_str());
cmd = "sudo fuser -muvf " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
system(cmd.c_str());
}
sleep(2);
//Flush the cache
@ -1834,7 +1825,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
if ( !rootUser)
{
cmd = "sudo chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /dev/null";
cmd = "chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /dev/null";
system(cmd.c_str());
}
@ -1875,16 +1866,8 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
int status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 )
{
if ( rootUser)
{
cmd = "echo " + entry + " >> /etc/fstab";
}
else
{
cmd = "sudo echo " + entry + " >> /etc/fstab";
}
system(cmd.c_str());
log.writeLog(__LINE__, "Add line entry to /etc/fstab : " + entry);
@ -1895,15 +1878,8 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 )
{
if ( rootUser)
{
cmd = "echo " + entry + " >> " + startup::StartUp::installDir() + "/local/etc/pm1/fstab";
}
else
{
cmd = "sudo echo " + entry + " >> " + startup::StartUp::installDir() + "/local/etc/pm1/fstab";
}
system(cmd.c_str());
@ -1915,14 +1891,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
string::size_type pos1 = entry.find(" ", pos + 1);
string directory = entry.substr(pos + 1, pos1 - pos);
if ( rootUser)
{
cmd = "mkdir " + directory;
}
else
{
cmd = "sudo mkdir " + directory;
}
system(cmd.c_str());
log.writeLog(__LINE__, "create directory: " + directory);
@ -3134,7 +3103,7 @@ int ProcessMonitor::updateLog(std::string action, std::string level)
//if non-root, change file permissions so we can update it
if ( !rootUser)
{
string cmd = "sudo chmod 666 " + fileName + " > /dev/null";
string cmd = "chmod 666 " + fileName + " > /dev/null";
system(cmd.c_str());
}
@ -5224,16 +5193,10 @@ int ProcessMonitor::changeMyCnf(std::string type)
// set owner and permission
string cmd = "chmod 664 " + mycnfFile + " >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo chmod 644 " + mycnfFile + " >/dev/null 2>&1";
system(cmd.c_str());
cmd = "chown mysql:mysql " + mycnfFile + " >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo chown mysql:mysql " + mycnfFile + " >/dev/null 2>&1";
system(cmd.c_str());
// restart mysql
@ -5987,10 +5950,7 @@ bool ProcessMonitor::amazonVolumeCheck(int dbrootID)
{
string cmd;
if ( rootUser)
cmd = "mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o defaults > /tmp/um_mount.log";
else
cmd = "sudo mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o defaults > /tmp/um_mount.log";
system(cmd.c_str());
log.writeLog(__LINE__, "mount cmd: " + cmd, LOG_TYPE_DEBUG);
@ -6399,7 +6359,7 @@ int ProcessMonitor::checkDataMount()
if ( !rootUser)
{
cmd = "sudo chown -R " + USER + ":" + USER + " " + dbroot + " > /dev/null";
cmd = "chown -R " + USER + ":" + USER + " " + dbroot + " > /dev/null";
system(cmd.c_str());
}
@ -6573,16 +6533,8 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
moduleIPAddr = sysConfig->getConfig("SystemModuleConfig", dataDupIPaddr);
}
if ( rootUser)
{
command = "mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
}
else
{
command = "sudo mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
}
int ret = system(command.c_str());
@ -6624,14 +6576,7 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
if ( rootUser)
{
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
}
else
{
command = "sudo umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
}
int ret = system(command.c_str());