Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On a package upgrade, restart telegraf. #338

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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