Skip to content
Snippets Groups Projects
Commit a18eedb9 authored by Lukasz Jagiello's avatar Lukasz Jagiello Committed by Daniel Nelson
Browse files

Use deb-systemd-invoke to restart service (#3506)

From man page:
```
deb-systemd-invoke is a Debian-specific helper script which asks
       /usr/sbin/policy-rc.d before performing a systemctl call.

deb-systemd-invoke is intended to be used from maintscripts to start
       systemd unit files. It is specifically NOT intended to be used
       interactively by users. Instead, users should run systemd and use
       systemctl, or not bother about the systemd enabled state in case they
       are not running systemd.
```

This PR replace regular `systemctl` with `deb-systemd-invoke`.
parent 6514399b
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ elif [[ -f /etc/debian_version ]]; then
# Debian/Ubuntu logic
if [[ "$(readlink /proc/1/exe)" == */systemd ]]; then
install_systemd /lib/systemd/system/telegraf.service
systemctl restart telegraf || echo "WARNING: systemd not running."
deb-systemd-invoke restart telegraf.service || echo "WARNING: systemd not running."
else
# Assuming SysVinit
install_init
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment