Closed KevinAAl closed 1 year ago
Telegraf does not start automatically after update
First some background, the telegraf deb no longer starts the service on the initial install. The provided config does not work out of the box and was never valid. It was weird to start the service automatically when nothing would work and then systemd would report a failed unit when the user had not had an opportunity to configure it. The change also aligns the behavior with the rpm packaging, which does not automatically start the service either.
That change made in v1.25.0, meant that when you upgraded from v1.25.0 (and only this version), the service would be stopped and not start again on an upgrade. As noted, this was the wrong behavior. A second change to not stop the service on upgrade and only start the service if it was already running went in and will apply to the upgrade of v1.25.1 to the next version. You can verify this on a system running v1.25.1 and upgrade to a nightly build.
I'm also having this same issue since upgrading from 1.24.3-1 to 1.25.1-1.
Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!
Relevant telegraf.conf
Logs from Telegraf
System info
Debian 11.6 with SystemD / Telegraf 1.25.1 (git: HEAD@e1a0d74e)
Docker
I don't use Docker.
Steps to reproduce
Expected behavior
Telegraf restarts automatically after update
Actual behavior
Telegraf does not start automatically after update
Additional info
To fix, I only have to start Telegraf manually after update:
service telegraf start
No error after start:
Log from unattended-upgrade (/var/log/apt/history.log) :
Start-Date: 2023-02-03 06:04:42 Commandline: /usr/bin/unattended-upgrade Upgrade: telegraf:amd64 (1.25.0-1, 1.25.1-1) End-Date: 2023-02-03 06:04:44
I think the problem comes from the update of the postinst in the telegraf package. Before, the postinst restarted Telegraf as follows:
On the last package, the script is as follows:
The command
deb-systemd-invoke restart telegraf.service
restart Telegraf or start Telegraf if it is stopped. The commanddeb-systemd-invoke try-restart telegraf.service
only restart telegraf but does not start telegraf if it is stopped. As Telegraf is automatically stopped at the start of the update, it never restarts.Currently we have to start Telegraf on all of our servers after update and we lose metrics in between. Can you restore the original configuration?
Thanks