From 9cfe199154aeeba559672cffa4c68728474a54d9 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 25 Sep 2018 13:35:06 -0500 Subject: [PATCH] MCOL-520 --- dbcon/execplan/sessionmonitor.h | 1 - ddlproc/ddlproc.cpp | 3 --- exemgr/main.cpp | 3 --- oamapps/postConfigure/installer.cpp | 13 +++++++++---- oamapps/resourceMonitor/hardwareMonitor.cpp | 12 +++++++++--- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dbcon/execplan/sessionmonitor.h b/dbcon/execplan/sessionmonitor.h index af7a9fb07..42a9ec899 100644 --- a/dbcon/execplan/sessionmonitor.h +++ b/dbcon/execplan/sessionmonitor.h @@ -58,7 +58,6 @@ namespace execplan * SessionMonitor/SharedMemoryTmpFile: the file to store the shared memory segment * data in. This needs to be a different file than * file used for the SessionManager/SharedMemoryTmpFile. - * The default is /tmp/CalpontMonShm. */ /* diff --git a/ddlproc/ddlproc.cpp b/ddlproc/ddlproc.cpp index e721462fe..4fbee7843 100644 --- a/ddlproc/ddlproc.cpp +++ b/ddlproc/ddlproc.cpp @@ -79,9 +79,6 @@ void setupCwd() workdir = "."; (void)chdir(workdir.c_str()); - - if (access(".", W_OK) != 0) - (void)chdir("/tmp"); } void added_a_pm(int) diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 05fdc600f..47f71140c 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -1324,9 +1324,6 @@ void setupCwd(ResourceManager* rm) { string workdir = startup::StartUp::tmpDir(); (void)chdir(workdir.c_str()); - - if (access(".", W_OK) != 0) - (void)chdir("/tmp"); } void startRssMon(size_t maxPct, int pauseSeconds) diff --git a/oamapps/postConfigure/installer.cpp b/oamapps/postConfigure/installer.cpp index f472ef494..3cde4f24e 100644 --- a/oamapps/postConfigure/installer.cpp +++ b/oamapps/postConfigure/installer.cpp @@ -56,6 +56,8 @@ using namespace config; #include "helpers.h" using namespace installer; +#include "installdir.h" + typedef struct Module_struct { std::string moduleName; @@ -169,6 +171,8 @@ int main(int argc, char* argv[]) if (p && *p) USER = p; + + string tmpDir = startup::StartUp::tmpDir(); // setup to start on reboot, for non-root amazon installs if ( !rootUser ) @@ -882,17 +886,18 @@ int main(int argc, char* argv[]) { cout << " DONE" << endl; - cmd = installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log"; + string logFile = tmpDir + "/dbbuilder.log"; + cmd = installDir + "/bin/dbbuilder 7 > " + logFile; system(cmd.c_str()); - if (oam.checkLogStatus("/tmp/dbbuilder.log", "System Catalog created") ) + if (oam.checkLogStatus(logFile, "System Catalog created") ) cout << endl << "System Catalog Successfull Created" << endl; else { - if ( !oam.checkLogStatus("/tmp/dbbuilder.log", "System catalog appears to exist") ) + if ( !oam.checkLogStatus(logFile, "System catalog appears to exist") ) { cout << endl << "System Catalog Create Failure" << endl; - cout << "Check latest log file in /tmp/dbbuilder.log.*" << endl; + cout << "Check latest log file in " << logFile" << endl; cout << " IMPORTANT: Once issue has been resolved, rerun postConfigure" << endl << endl; exit (1); } diff --git a/oamapps/resourceMonitor/hardwareMonitor.cpp b/oamapps/resourceMonitor/hardwareMonitor.cpp index 6877836b4..9ec322b2e 100644 --- a/oamapps/resourceMonitor/hardwareMonitor.cpp +++ b/oamapps/resourceMonitor/hardwareMonitor.cpp @@ -34,6 +34,8 @@ #include "loggingid.h" #include "alarmmanager.h" +#include "installdir.h" + using namespace std; using namespace oam; using namespace alarmmanager; @@ -80,11 +82,15 @@ int main (int argc, char** argv) string highCritical; string highFatal; char* p; + + string tmpDir = startup::StartUp::tmpDir(); // loop forever reading the hardware status while (TRUE) { - int returnCode = system("ipmitool sensor list > /tmp/harwareMonitor.txt"); + string logFile = tmpDir + "/harwareMonitor.txt"; + string cmd = "ipmitool sensor list > " + logFile; + int returnCode = system(cmd.c_str()); if (returnCode) { @@ -95,12 +101,12 @@ int main (int argc, char** argv) // parse output file - ifstream File ("/tmp/harwareMonitor.txt"); + ifstream File (logFile); if (!File) { // System error - cout << "Error opening /tmp/harwareMonitor.txt!!!" << endl; + cout << "Error opening " << logFile << endl; exit(-1); }