Fixed install/remove of telegraf on non-systemd Debian/Ubuntu systems (#2360)

This commit is contained in:
Martin
2017-04-20 20:19:33 +02:00
committed by Daniel Nelson
parent bf30ef89ee
commit 748ca7d503
5 changed files with 81 additions and 51 deletions

View File

@@ -5,11 +5,10 @@ BIN_DIR=/usr/bin
# Distribution-specific logic
if [[ -f /etc/debian_version ]]; then
# Debian/Ubuntu logic
which systemctl &>/dev/null
if [[ $? -eq 0 ]]; then
deb-systemd-invoke stop telegraf.service
if [[ "$(readlink /proc/1/exe)" == */systemd ]]; then
deb-systemd-invoke stop telegraf.service
else
# Assuming sysv
invoke-rc.d telegraf stop
# Assuming sysv
invoke-rc.d telegraf stop
fi
fi