blob: ea7984da54bccec5c8db25c345f59a4edd4e65d7 [file] [log] [blame]
Deepak Kodihallic4966192018-08-23 02:19:58 -05001#pragma once
2
3#include "config.h"
4#include <sdbusplus/bus.hpp>
5
6namespace phosphor
7{
8namespace rsyslog_utils
9{
10
11/** @brief Restart rsyslog's systemd unit
12 */
13void 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