#include #include #include #include #include namespace watchdog { namespace dump { using namespace phosphor::logging; void transitionHost(const std::string& target) { constexpr auto systemdService = "org.freedesktop.systemd1"; constexpr auto systemdObjPath = "/org/freedesktop/systemd1"; constexpr auto systemdInterface = "org.freedesktop.systemd1.Manager"; auto bus = sdbusplus::bus::new_system(); auto method = bus.new_method_call(systemdService, systemdObjPath, systemdInterface, "StartUnit"); method.append(target); // target unit to start method.append("replace"); bus.call_noreply(method); // start the service } } // namespace dump } // namespace watchdog