Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Systemd for Amazon Linux 2 #5387

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions scripts/post-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down