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
  • Loading branch information
powersj authored Mar 21, 2024
1 parent dfdb804 commit 21f355a
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 21f355a

Please sign in to comment.