1 #include <attn_logging.hpp>
2 #include <sdbusplus/bus.hpp>
3 
4 namespace attn
5 {
6 
7 /** @brief Start host diagnostic mode systemd unit */
8 void tiHandler()
9 {
10     // trace message
11     trace<level::INFO>("start host diagnostic mode service");
12 
13     // Use the systemd service manager object interface to call the start unit
14     // method with the obmc-host-diagnostic-mode target.
15     auto bus    = sdbusplus::bus::new_system();
16     auto method = bus.new_method_call(
17         "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
18         "org.freedesktop.systemd1.Manager", "StartUnit");
19 
20     method.append("obmc-host-diagnostic-mode@0.target"); // unit to activate
21     method.append("replace"); // mode = replace conflicting queued jobs
22     bus.call_noreply(method); // start the service
23 
24     return;
25 }
26 
27 } // namespace attn
28