Skip to content

Commit

Permalink
Use Systemd for Amazon Linux 2 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnaraasen committed Feb 7, 2019
1 parent 5e1e0b1 commit fa6e5be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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
elif [[ "$NAME" = "Amazon Linux AMI" ]]; then
# Amazon Linux logic
install_init
install_chkconfig
Expand Down
14 changes: 9 additions & 5 deletions scripts/post-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ elif [[ -f /etc/lsb-release ]]; 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/influxdb
if [[ "$ID" = "amzn" ]] && [[ "$1" = "0" ]]; then
# InfluxDB is no longer installed, remove from init system
rm -f /etc/default/influxdb

if [[ "$NAME" = "Amazon Linux" ]]; then
# Amazon Linux 2+ logic
disable_systemd
elif [[ $NAME = "Amazon Linux AMI" ]]; then
# Amazon Linux logic
disable_chkconfig
fi
fi
Expand Down

0 comments on commit fa6e5be

Please sign in to comment.