From 9c45a2150dea284c81b7e2dfdc4363a025969344 Mon Sep 17 00:00:00 2001 From: Lukasz Jagiello Date: Mon, 27 Nov 2017 17:05:32 -0800 Subject: [PATCH] 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`. --- scripts/post-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/post-install.sh b/scripts/post-install.sh index 9dc231a30..6c73fef8e 100644 --- a/scripts/post-install.sh +++ b/scripts/post-install.sh @@ -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