blob: 163fc8cc73a177510c2f9a1441615d58bfe1b2e5 [file] [log] [blame]
#include "health_utils.hpp"
#include <phosphor-logging/lg2.hpp>
PHOSPHOR_LOG2_USING;
namespace phosphor::health::utils
{
void startUnit(sdbusplus::bus_t& bus, const std::string& sysdUnit)
{
if (sysdUnit.empty())
{
return;
}
sdbusplus::message_t msg = bus.new_method_call(
"org.freedesktop.systemd1", "/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager", "StartUnit");
msg.append(sysdUnit, "replace");
bus.call_noreply(msg);
}
} // namespace phosphor::health::utils