diff --git a/procmgr/processmanager.cpp b/procmgr/processmanager.cpp index ae76401ca..db44342ea 100644 --- a/procmgr/processmanager.cpp +++ b/procmgr/processmanager.cpp @@ -6855,7 +6855,14 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist) } //run command to build system table if they don't already exist - processManager.buildSystemTables("pm1"); + sleep(5); + int ret = processManager.buildSystemTables("pm1"); + if (ret == oam::API_SUCCESS ) + log.writeLog(__LINE__, "System Catalog Successfully Built by ProcMgr", LOG_TYPE_DEBUG); + else + log.writeLog(__LINE__, "System Catalog Successfully not built by ProcMgr, ret code = " + oam.itoa(ret), LOG_TYPE_DEBUG); + + log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG); // exit thread log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG); diff --git a/procmon/processmonitor.cpp b/procmon/processmonitor.cpp index 093f92305..8da3a6734 100644 --- a/procmon/processmonitor.cpp +++ b/procmon/processmonitor.cpp @@ -3480,6 +3480,17 @@ int ProcessMonitor::buildSystemTables() oam.getSystemConfig("DBRoot1", DBdir); string fileName = DBdir + "/000.dir"; + + //check if postConfigure or dbbuilder is running, return if so + string cmd = "ps aux | grep postConfigure | grep -v grep"; + int rtnCode = system(cmd.c_str()); + if (WEXITSTATUS(rtnCode) == 0) + return API_ALREADY_IN_PROGRESS; + + cmd = "ps aux | grep dbbuilder | grep -v grep"; + rtnCode = system(cmd.c_str()); + if (WEXITSTATUS(rtnCode) == 0) + return API_ALREADY_IN_PROGRESS; if (!IDBPolicy::exists(fileName.c_str())) { string logdir("/var/log/mariadb/columnstore"); @@ -3490,7 +3501,7 @@ int ProcessMonitor::buildSystemTables() log.writeLog(__LINE__, "buildSystemTables: dbbuilder 7 Successfully Launched" , LOG_TYPE_DEBUG); return API_SUCCESS; } - log.writeLog(__LINE__, "buildSystemTables: System Tables Already Exist", LOG_TYPE_ERROR ); + log.writeLog(__LINE__, "buildSystemTables: System Tables Already Exist", LOG_TYPE_DEBUG ); return API_FILE_ALREADY_EXIST; }