summaryrefslogtreecommitdiffstats
path: root/phosphor-rsyslog-config/utils.hpp
blob: 017a4394692813bad50e185ec8ff7f4bb710798e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "config.h"

#include <sdbusplus/bus.hpp>

namespace phosphor
{
namespace rsyslog_utils
{

/** @brief Restart rsyslog's systemd unit
 */
void restart()
{
    auto bus = sdbusplus::bus::new_default();
    auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
                                      SYSTEMD_INTERFACE, "RestartUnit");
    method.append("rsyslog.service", "replace");
    bus.call_noreply(method);
}

} // namespace rsyslog_utils
} // namespace phosphor
OpenPOWER on IntegriCloud