Fixed install/remove of telegraf on non-systemd Debian/Ubuntu systems (#2360)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user