diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4b6dfc2..2dd135eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ changed to just run docker commands in the Makefile. See `make docker-run` and ### Features - [#325](https://github.com/influxdb/telegraf/pull/325): NSQ output. Thanks @jrxFive! - [#318](https://github.com/influxdb/telegraf/pull/318): Prometheus output. Thanks @oldmantaiter! +- [#338](https://github.com/influxdb/telegraf/pull/338): Restart Telegraf on package upgrade. Thanks @linsomniac! ### Bugfixes - [#331](https://github.com/influxdb/telegraf/pull/331): Dont overwrite host tag in redis plugin. diff --git a/scripts/package.sh b/scripts/package.sh index 43142cf7e..52891a0cc 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -169,6 +169,11 @@ if which systemctl > /dev/null 2>&1 ; then /lib/systemd/system/telegraf.service systemctl enable telegraf + # restart on upgrade of package + if [ "$#" -eq 2 ]; then + systemctl restart telegraf + fi + # Sysv else ln -sfn $INSTALL_ROOT_DIR/versions/$version/scripts/init.sh \ @@ -185,6 +190,11 @@ else chkconfig --add telegraf fi + # restart on upgrade of package + if [ "$#" -eq 2 ]; then + /etc/init.d/telegraf restart + fi + mkdir -p $TELEGRAF_LOG_DIR chown -R -L telegraf:telegraf $TELEGRAF_LOG_DIR fi