Skip to content

Commit

Permalink
chore: restart service if it is already running and upgraded via RPM (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
nerijus authored Dec 13, 2021
1 parent 393c5e6 commit 5cb9939
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/rpm/post-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ if [[ -f /etc/redhat-release ]] || [[ -f /etc/SuSE-release ]]; then
disable_chkconfig
fi
fi
if [[ $1 -ge 1 ]]; then
# Package upgrade, not uninstall

if [[ "$(readlink /proc/1/exe)" == */systemd ]]; then
systemctl try-restart telegraf.service >/dev/null 2>&1 || :
fi
fi
elif [[ -f /etc/os-release ]]; then
source /etc/os-release
if [[ "$ID" = "amzn" ]] && [[ "$1" = "0" ]]; then
Expand Down

0 comments on commit 5cb9939

Please sign in to comment.