Break out Dbus events into class

EventServiceManager is already too large.  Implement the TODO from run
that these should be classes, and fix the issue where events are being
registered on startup, not on a subscription being created.

To accomplish this, this patch takes global state and breaks them out
into RAII classes from EventServiceManager, one for monitoring DBus
matches, and one for monitoring filesystem log events using inotify.
Each of these connect to static methods on EventService that can send
the relevant events to the user.

Fundamentally, no code within the two new classes is changed, and the
only changes to event service are made to support creation and
destruction of the RAII classes.

There are a number of call sites, like cacheRedfishLogFile, that are
obsoleted when the class is raii.  The file will be re-cached on
creation.

Tested: WIP
No TelemetryService tests exist in Redfish.

Change-Id: Ibc91cd1496edf4a080e2d60bfc1a32e00a6c74b8
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/src/webserver_run.cpp b/src/webserver_run.cpp
index dfed2b7..eddfc5b 100644
--- a/src/webserver_run.cpp
+++ b/src/webserver_run.cpp
@@ -6,7 +6,6 @@
 #include "dbus_monitor.hpp"
 #include "dbus_singleton.hpp"
 #include "event_service_manager.hpp"
-#include "filesystem_log_watcher.hpp"
 #include "google/google_service_root.hpp"
 #include "hostname_monitor.hpp"
 #include "ibm/management_console_rest.hpp"
@@ -79,9 +78,10 @@
     if constexpr (BMCWEB_REDFISH)
     {
         redfish::RedfishService redfish(app);
-
-        // Create EventServiceManager instance and initialize Config
-        redfish::EventServiceManager::getInstance(&*io);
+        if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
+        {
+            redfish::EventServiceManager::getInstance(&*io);
+        }
 
         if constexpr (BMCWEB_REDFISH_AGGREGATION)
         {
@@ -116,16 +116,6 @@
 
     crow::login_routes::requestRoutes(app);
 
-    if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
-    {
-        int rc = redfish::startEventLogMonitor(*io);
-        if (rc != 0)
-        {
-            BMCWEB_LOG_ERROR("Redfish event handler setup failed...");
-            return rc;
-        }
-    }
-
     if constexpr (!BMCWEB_INSECURE_DISABLE_SSL)
     {
         BMCWEB_LOG_INFO("Start Hostname Monitor Service...");
@@ -142,8 +132,5 @@
 
     crow::connections::systemBus = nullptr;
 
-    // TODO(ed) Make event log monitor an RAII object instead of global vars
-    redfish::stopEventLogMonitor();
-
     return 0;
 }