Deepak Kodihalli | c496619 | 2018-08-23 02:19:58 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "config.h" |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 4 | |
Deepak Kodihalli | c496619 | 2018-08-23 02:19:58 -0500 | [diff] [blame] | 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(); |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 17 | auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, |
| 18 | SYSTEMD_INTERFACE, "RestartUnit"); |
Deepak Kodihalli | c496619 | 2018-08-23 02:19:58 -0500 | [diff] [blame] | 19 | method.append("rsyslog.service", "replace"); |
| 20 | bus.call_noreply(method); |
| 21 | } |
| 22 | |
| 23 | } // namespace rsyslog_utils |
| 24 | } // namespace phosphor |