diff --git a/config.h.cmake b/config.h.cmake index e320eb82c..74d707b11 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -2,6 +2,9 @@ #ifndef TEST_CONFIG_H #define TEST_CONFIG_H +/* Define to 1 to let the system come up without using OAM */ +#cmakedefine SKIP_OAM_INIT 1 + /* Define to 1 if you have the `alarm' function. */ #cmakedefine HAVE_ALARM 1 diff --git a/configureEngine.cmake b/configureEngine.cmake index 0a299c146..a3ac9d3c1 100644 --- a/configureEngine.cmake +++ b/configureEngine.cmake @@ -716,7 +716,9 @@ IF (NOT INLINE) SET (inline "") ENDIF() - +IF($ENV{SKIP_OAM_INIT}) + SET(SKIP_OAM_INIT 1) +ENDIF() EXECUTE_PROCESS( COMMAND rm -f conftest.data conftest.file conftest.sym diff --git a/exemgr/main.cpp b/exemgr/main.cpp index afecb1129..7f91d1d4a 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -63,6 +63,7 @@ using namespace std; #include using namespace boost; +#include "config.h" #include "configcpp.h" using namespace config; #include "messagequeue.h" @@ -100,6 +101,10 @@ using namespace querytele; #include "threadpool.h" #include "crashtrace.h" +#if defined(SKIP_OAM_INIT) +#include "dbrm.h" +#endif + #include "installdir.h" namespace @@ -1322,8 +1327,11 @@ void setupSignalHandlers() void setupCwd(ResourceManager* rm) { - string workdir = startup::StartUp::tmpDir(); + string workdir = rm->getScWorkingDir(); (void)chdir(workdir.c_str()); + + if (access(".", W_OK) != 0) + (void)chdir("/tmp"); } void startRssMon(size_t maxPct, int pauseSeconds) @@ -1370,11 +1378,14 @@ void cleanTempDir() { config::Config* config = config::Config::makeConfig(); string allowDJS = config->getConfig("HashJoin", "AllowDiskBasedJoin"); - string tmpPrefix = startup::StartUp::tmpDir(); + string tmpPrefix = config->getConfig("HashJoin", "TempFilePath"); if (allowDJS == "N" || allowDJS == "n") return; - + + if (tmpPrefix.empty()) + tmpPrefix = "/tmp/infinidb"; + tmpPrefix += "/"; assert(tmpPrefix != "/"); @@ -1597,6 +1608,11 @@ int main(int argc, char* argv[]) { } } +#if defined(SKIP_OAM_INIT) + BRM::DBRM *dbrm = new BRM::DBRM(); + dbrm->setSystemQueryReady(true); + delete dbrm; +#endif threadpool::ThreadPool exeMgrThreadPool(serverThreads, 0); exeMgrThreadPool.setName("ExeMgrServer"); diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index a0bd6103e..73bf5c9d2 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -56,6 +56,7 @@ #ifdef _MSC_VER #include "idbregistry.h" #endif +#include "config.h" #include "installdir.h" #include "dbrm.h" #include "sessionmanager.h" diff --git a/oam/oamcpp/oamcache.cpp b/oam/oamcpp/oamcache.cpp index 084f88157..d8035bbf3 100644 --- a/oam/oamcpp/oamcache.cpp +++ b/oam/oamcpp/oamcache.cpp @@ -34,6 +34,7 @@ using namespace boost; #include "exceptclasses.h" #include "configcpp.h" #include "installdir.h" +#include "config.h" namespace { @@ -180,6 +181,7 @@ void OamCache::checkReload() } } #else + pmToConnectionMap[*it] = i++; moduleIds.push_back(*it); #endif it++; diff --git a/writeengine/redistribute/we_redistributecontrolthread.cpp b/writeengine/redistribute/we_redistributecontrolthread.cpp index ab2897834..70b5d1e2d 100644 --- a/writeengine/redistribute/we_redistributecontrolthread.cpp +++ b/writeengine/redistribute/we_redistributecontrolthread.cpp @@ -37,6 +37,7 @@ using namespace std; #include "boost/filesystem/operations.hpp" using namespace boost; +#include "config.h" #include "installdir.h" #include "configcpp.h" diff --git a/writeengine/splitter/we_sdhandler.cpp b/writeengine/splitter/we_sdhandler.cpp index a1db530ae..c2120c529 100644 --- a/writeengine/splitter/we_sdhandler.cpp +++ b/writeengine/splitter/we_sdhandler.cpp @@ -43,6 +43,7 @@ using namespace std; #include using namespace boost; +#include "config.h" #include "configcpp.h" using namespace config;