crit-service: create error on failed service
This enhances the existing code to support logging an error when a
monitored service fails. The same systemd event is triggered for a
target failure and a service failure so no new logic is needed in
that area.
Tested:
- Repeatedly killed the host-state service until its unit went into the
failed state. Verified this was detected and the expected log was
created.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I459dd8c35ceddec986336fee635fdf691257f758
diff --git a/systemd_target_monitor.cpp b/systemd_target_monitor.cpp
index 0d8ae74..a02f693 100644
--- a/systemd_target_monitor.cpp
+++ b/systemd_target_monitor.cpp
@@ -85,7 +85,8 @@
dump_targets(targetData);
}
- phosphor::state::manager::SystemdTargetLogging targetMon(targetData, bus);
+ phosphor::state::manager::SystemdTargetLogging targetMon(targetData,
+ serviceData, bus);
// Subscribe to systemd D-bus signals indicating target completions
targetMon.subscribeToSystemdSignals();