On a package upgrade, restart telegraf.

closes #338
This commit is contained in:
Sean Reifschneider
2015-11-02 09:21:20 -07:00
committed by Cameron Sparr
parent 0398dc1226
commit a992e16f7d
2 changed files with 11 additions and 0 deletions

View File

@@ -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