summaryrefslogtreecommitdiffstats
path: root/monitor/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/main.cpp')
-rw-r--r--monitor/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/monitor/main.cpp b/monitor/main.cpp
index 5da6a5b..b9c1d81 100644
--- a/monitor/main.cpp
+++ b/monitor/main.cpp
@@ -15,6 +15,7 @@
*/
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
+#include <systemd/sd-daemon.h>
#include "event.hpp"
#include "fan.hpp"
#include "fan_defs.hpp"
@@ -48,6 +49,15 @@ int main()
fans.emplace_back(std::make_unique<Fan>(bus, eventPtr, fanDef));
}
+ //Tell systemd we are initialized
+ r = sd_notify(0, "READY=1");
+ if (r < 1) // 0 = nothing sent, < 0 is a failure
+ {
+ log<level::ERR>("sd_notify did not send anything",
+ entry("ERROR=%d", r));
+ return -1;
+ }
+
r = sd_event_loop(eventPtr.get());
if (r < 0)
{
OpenPOWER on IntegriCloud