Initialize Event Service Config on bmcweb restart
Added instantiation of EventServiceManager Object to
initialize Event Service Config and register the subscriptions
from the config.
During BMC boot, there would be many redfish events logged
due to which, once bmcweb service is up, the EventServiceManager
object is instantiated by getInstance method called from
inotify. But, on bmcweb service restart, the getInstance
method is not called untill a redfish event is logged, or
untill a GET/POST/PATCH/DELETE etc. call is made to
/redfish/v1/EventService route, due to which none of the
Subscriptions would be functional.
Hence this commit.
Tested:
- Subscribed Events were successfully received on restart
of bmcweb Service as well as on reboot of bmc
- Redfish validator passed
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Change-Id: I50b6fd21a262e7b73fbf9f2ac94c1ffdacef4800
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index 014c2ff..3b9631a 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -79,6 +79,10 @@
#ifdef BMCWEB_ENABLE_REDFISH
crow::redfish::requestRoutes(app);
+ redfish::RedfishService redfish(app);
+
+ // Create EventServiceManager instance and initialize Config
+ redfish::EventServiceManager::getInstance();
#endif
#ifdef BMCWEB_ENABLE_DBUS_REST
@@ -116,8 +120,6 @@
crow::nbd_proxy::requestRoutes(app);
#endif
- redfish::RedfishService redfish(app);
-
#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
int rc = redfish::EventServiceManager::startEventLogMonitor(*io);
if (rc)