Skip to content

Commit

Permalink
fix(windows): Ensure watch-config is passed to service (#15040)
Browse files Browse the repository at this point in the history
(cherry picked from commit 21f355a)
  • Loading branch information
powersj committed Apr 1, 2024
1 parent 4a6a860 commit cc54d45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/telegraf/telegraf_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func (t *Telegraf) runAsWindowsService() error {
svcConfig.Arguments = append(svcConfig.Arguments, "--config-directory", fConfigDirectory)
}

if t.watchConfig != "" {
svcConfig.Arguments = append(svcConfig.Arguments, "--watch-config", t.watchConfig)
}

//set servicename to service cmd line, to have a custom name after relaunch as a service
svcConfig.Arguments = append(svcConfig.Arguments, "--service-name", t.serviceName)

Expand Down

0 comments on commit cc54d45

Please sign in to comment.