Skip to content

Commit

Permalink
On a package upgrade, restart telegraf.
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac authored and Jeffrey Allen committed Nov 18, 2015
1 parent 1353ba7 commit 760b663
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 760b663

Please sign in to comment.