summaryrefslogtreecommitdiff
path: root/src/webserver_main.cpp
diff options
context:
space:
mode:
authorAppaRao Puli <apparao.puli@linux.intel.com>2021-03-24 02:36:40 +0300
committerEd Tanous <ed@tanous.net>2021-03-31 23:29:41 +0300
commitf6f97199eb879540fb807645795149a7f6b9ae35 (patch)
tree9964f124b5fa4ae6c78268507eddcfb73863afd9 /src/webserver_main.cpp
parent4dbb8aea7651dc61a4dc384625567b34393742a2 (diff)
downloadbmcweb-f6f97199eb879540fb807645795149a7f6b9ae35.tar.xz
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 <apparao.puli@linux.intel.com> Change-Id: Iab52f0e89478e306af475066fb5691153a05677d
Diffstat (limited to 'src/webserver_main.cpp')
-rw-r--r--src/webserver_main.cpp6
1 files changed, 3 insertions, 3 deletions
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<boost::asio::io_context>();
App app(io);
+ crow::connections::systemBus =
+ std::make_shared<sdbusplus::asio::connection>(*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<sdbusplus::asio::connection>(*io);
-
#ifdef BMCWEB_ENABLE_VM_NBDPROXY
crow::nbd_proxy::requestRoutes(app);
#endif