blob: 163fc8cc73a177510c2f9a1441615d58bfe1b2e5 [file] [log] [blame]
Jagpal Singh Gill23f091e2023-12-10 15:23:19 -08001#include "health_utils.hpp"
2
3#include <phosphor-logging/lg2.hpp>
4
5PHOSPHOR_LOG2_USING;
6
7namespace phosphor::health::utils
8{
9
10void startUnit(sdbusplus::bus_t& bus, const std::string& sysdUnit)
11{
12 if (sysdUnit.empty())
13 {
14 return;
15 }
16 sdbusplus::message_t msg = bus.new_method_call(
17 "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
18 "org.freedesktop.systemd1.Manager", "StartUnit");
19 msg.append(sysdUnit, "replace");
20 bus.call_noreply(msg);
21}
22
23} // namespace phosphor::health::utils