From 662604553538795f9a03e1167c7b44376349a56a Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Tue, 2 Oct 2018 16:33:06 -0500 Subject: [PATCH] WIP. First cut of excising OAM and root access from the dev process. This passes most tests; need to make sure that the tests that fail have nothing to do with this change. DMLProc is doing something that results in a sudo password prompt. Will obliterate that next. --- config.h.cmake | 3 +++ configureEngine.cmake | 3 +++ exemgr/main.cpp | 10 ++++++++++ oam/oamcpp/liboamcpp.cpp | 1 + oam/oamcpp/oamcache.cpp | 4 +++- 5 files changed, 20 insertions(+), 1 deletion(-) 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..b06746792 100644 --- a/configureEngine.cmake +++ b/configureEngine.cmake @@ -17,6 +17,9 @@ INCLUDE (CheckSymbolExists) INCLUDE (CheckCXXSymbolExists) INCLUDE (CheckTypeSize) +IF($ENV{SKIP_OAM_INIT}) + SET(SKIP_OAM_INIT 1) +ENDIF() CHECK_INCLUDE_FILE_CXX (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILE_CXX (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILE_CXX (dlfcn.h HAVE_DLFCN_H) diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 8742188a0..4e3b42347 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 + namespace { @@ -1601,6 +1606,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 d53dd66de..bba892b0d 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..fcda0aa4c 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 { @@ -83,7 +84,7 @@ void OamCache::checkReload() for (uint32_t i = 0; i < dbroots.size(); i++) { oam.getDbrootPmConfig(dbroots[i], temp); - //cout << " dbroot " << dbroots[i] << " -> PM " << temp << endl; + cout << " dbroot " << dbroots[i] << " -> PM " << temp << endl; (*dbRootPMMap)[dbroots[i]] = temp; } @@ -180,6 +181,7 @@ void OamCache::checkReload() } } #else + pmToConnectionMap[*it] = i++; moduleIds.push_back(*it); #endif it++;