Bug #16225
closedTelegraf service does not restart after change of settings
100%
Description
Documented here: https://forum.netgate.com/topic/197682/telegraf-service-not-starting-after-change-of-setting
The Telegraf service does not restart when applying new settings. The root cause seems to be related to the use of the daemon and no wait between rc_stop and and rc_start in rc_restart. Solved by inserting a pwait after the kill:
--- /usr/local/pkg/telegraf.inc 2025-05-15 17:55:23.000000000 +0200
+++ /usr/local/pkg/telegraf.inc.new 2025-06-03 16:28:00.675486000 +0200
@@ -200,7 +200,7 @@
write_rcfile(array(
"file" => "telegraf.sh",
"start" => "/usr/sbin/daemon -crP {$pidfile} /usr/local/bin/telegraf -config={$conffile} 2> {$logfile}",
- "stop" => "/bin/kill `/bin/cat {$pidfile}`"
+ "stop" => "pid=`/bin/cat {$pidfile}`; /bin/kill \$pid; pwait \$pid"
)
);
Files
Updated by Bryan Allen 5 months ago
Verified this is happening on 25.07-DEVELOPMENT (amd64)
built on Fri Jun 6 1:00:00 CDT 2025
FreeBSD 15.0-CURRENT
changing features on Telegraf service takes the service down but does not re enable it.
Updated by Jim Pingle 4 months ago
- Affected Plus Version changed from 25.03 to 25.07
Updated by Marcos M 2 months ago
- Status changed from Confirmed to Feedback
- Assignee set to Marcos M
- Target version set to 2.9.0
- % Done changed from 0 to 100
- Plus Target Version set to 25.11
- Affected Architecture All added
- Affected Architecture deleted (
SG-2100)
Should be fixed with 448f354244343c1ebe15a10e14da85772f38dd26.
Updated by aleksei prokofiev 20 days ago
Tested on
25.07.1-RELEASE (amd64)
built on Wed Aug 20 16:17:00 +04 2025
FreeBSD 15.0-CURRENT
Can not fetch patch
Updated by Christopher Cope 18 days ago
- Status changed from Feedback to Resolved
The patch is to a package, so isn't in the main github repo and fetching by commit ID won't work.
Tested on
25.11-BETA (amd64) built on Fri Oct 3 13:35:00 UTC 2025 FreeBSD 15.0-PRERELEASE Telegraf 0.9.1
Changes no longer leave Telegraf stopped. Marking resolved.