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