Use Systemd for Amazon Linux 2 packages (#5387)

(cherry picked from commit 52bd698046)
This commit is contained in:
Gunnar
2019-02-19 14:58:58 -08:00
committed by Daniel Nelson
parent cea1247095
commit e8b6f7efa1
2 changed files with 13 additions and 6 deletions
+4 -1
View File
@@ -88,7 +88,10 @@ elif [[ -f /etc/debian_version ]]; then
fi
elif [[ -f /etc/os-release ]]; then
source /etc/os-release
if [[ $ID = "amzn" ]]; then
if [[ "$NAME" = "Amazon Linux" ]]; then
# Amazon Linux 2+ logic
install_systemd /usr/lib/systemd/system/telegraf.service
elif [[ "$NAME" = "Amazon Linux AMI" ]]; then
# Amazon Linux logic
install_init
# Run update-rc.d or fallback to chkconfig if not available
+9 -5
View File
@@ -48,11 +48,15 @@ elif [[ -f /etc/debian_version ]]; then
fi
elif [[ -f /etc/os-release ]]; then
source /etc/os-release
if [[ $ID = "amzn" ]]; then
# Amazon Linux logic
if [[ "$1" = "0" ]]; then
# InfluxDB is no longer installed, remove from init system
rm -f /etc/default/telegraf
if [[ "$ID" = "amzn" ]] && [[ "$1" = "0" ]]; then
# InfluxDB is no longer installed, remove from init system
rm -f /etc/default/telegraf
if [[ "$NAME" = "Amazon Linux" ]]; then
# Amazon Linux 2+ logic
disable_systemd /usr/lib/systemd/system/telegraf.service
elif [[ "$NAME" = "Amazon Linux AMI" ]]; then
# Amazon Linux logic
disable_chkconfig
fi
fi