Project

General

Profile

Actions

Bug #16225

closed
PS MM

Telegraf service does not restart after change of settings

Bug #16225: Telegraf service does not restart after change of settings

Added by Patrik Stahlman over 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Telegraf
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
25.11
Affected Version:
Affected Plus Version:
25.07
Affected Architecture:
All

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

clipboard-202510031319-dlo38.png (30.2 KB) clipboard-202510031319-dlo38.png aleksei prokofiev, 10/03/2025 10:19 AM

BA Updated by Bryan Allen over 1 year ago Actions #1

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.

BA Updated by Bryan Allen over 1 year ago Actions #2

  • Status changed from New to Confirmed

JP Updated by Jim Pingle about 1 year ago Actions #3

  • Affected Plus Version changed from 25.03 to 25.07

MM Updated by Marcos M about 1 year ago Actions #4

  • 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)

AP Updated by aleksei prokofiev 12 months ago Actions #5

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

CC Updated by Christopher Cope 11 months ago Actions #6

  • 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.

Actions

Also available in: Atom