sysd_monitor: Monitor and log errors
Note some aspects of the code are non-optimal to allow better unit
testing.
Tested:
- Verified failure detected and correct error created in qemu
Change-Id: I1d4c9638fc13147508168278cc5ab90c37e1fb8e
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/systemd_target_monitor.cpp b/systemd_target_monitor.cpp
index 2c58769..dc94951 100644
--- a/systemd_target_monitor.cpp
+++ b/systemd_target_monitor.cpp
@@ -4,6 +4,7 @@
#include <sdbusplus/bus.hpp>
#include <sdeventplus/event.hpp>
#include <systemd_target_parser.hpp>
+#include <systemd_target_signal.hpp>
#include <vector>
using phosphor::logging::level;
@@ -70,8 +71,10 @@
dump_targets(targetData);
}
- // TODO - Begin monitoring for systemd unit changes and logging appropriate
- // errors
+ phosphor::state::manager::SystemdTargetLogging targetMon(targetData, bus);
+
+ // Subscribe to systemd D-bus signals indicating target completions
+ targetMon.subscribeToSystemdSignals();
return event.loop();
}