From f6f97199eb879540fb807645795149a7f6b9ae35 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Tue, 23 Mar 2021 23:36:40 +0000 Subject: Move SystemBus init to early stage The bmcweb crash issue seen when there is eventservice config with subscriptions in persistent file. During EventService instantiation, it uses the "get_io_context()" from systemBus, so it should be called after systemBus init. So moved systemBus initialization to early stage of main process to avoid ordering issue. Tested: - bmcweb crash issue resolved. Signed-off-by: AppaRao Puli Change-Id: Iab52f0e89478e306af475066fb5691153a05677d --- src/webserver_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp index 960f591637..902c32b968 100644 --- a/src/webserver_main.cpp +++ b/src/webserver_main.cpp @@ -66,6 +66,9 @@ int main(int /*argc*/, char** /*argv*/) auto io = std::make_shared(); App app(io); + crow::connections::systemBus = + std::make_shared(*io); + // Static assets need to be initialized before Authorization, because auth // needs to build the whitelist from the static routes @@ -113,9 +116,6 @@ int main(int /*argc*/, char** /*argv*/) setupSocket(app); - crow::connections::systemBus = - std::make_shared(*io); - #ifdef BMCWEB_ENABLE_VM_NBDPROXY crow::nbd_proxy::requestRoutes(app); #endif -- cgit v1.2.3