1 #pragma once
2 
3 #include "config.h"
4 #include <sdbusplus/bus.hpp>
5 
6 namespace phosphor
7 {
8 namespace rsyslog_utils
9 {
10 
11 /** @brief Restart rsyslog's systemd unit
12  */
13 void restart()
14 {
15     auto bus = sdbusplus::bus::new_default();
16     auto method = bus.new_method_call(
17                       SYSTEMD_BUSNAME,
18                       SYSTEMD_PATH,
19                       SYSTEMD_INTERFACE,
20                       "RestartUnit");
21     method.append("rsyslog.service", "replace");
22     bus.call_noreply(method);
23 }
24 
25 } // namespace rsyslog_utils
26 } // namespace phosphor
27