Project

General

Profile

Actions

Bug #16225

open

Telegraf service does not restart after change of settings

Added by Patrik Stahlman 6 days ago. Updated 1 day ago.

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

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
25.03
Affected Architecture:
SG-2100

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" 
                )
        );

Actions #1

Updated by Bryan Allen 1 day 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.

Actions #2

Updated by Bryan Allen 1 day ago

  • Status changed from New to Confirmed
Actions

Also available in: Atom PDF