Keep -config-directory when running as Windows service (#2330)

* Keep -config-directory when running as Windows service

* Update changelog
This commit is contained in:
Pierre Fersing 2017-02-01 15:12:35 +01:00 committed by Cameron Sparr
parent 2932db8480
commit 32e06a489d
2 changed files with 4 additions and 1 deletions

View File

@ -11,10 +11,10 @@ It is highly recommended that all users migrate to the new riemann output plugin
### Features ### Features
- [#2141](https://github.com/influxdata/telegraf/pull/2141): Logparser handles newly-created files.
- [#2137](https://github.com/influxdata/telegraf/pull/2137): Added userstats to mysql input plugin. - [#2137](https://github.com/influxdata/telegraf/pull/2137): Added userstats to mysql input plugin.
- [#2179](https://github.com/influxdata/telegraf/pull/2179): Added more InnoDB metric to MySQL plugin. - [#2179](https://github.com/influxdata/telegraf/pull/2179): Added more InnoDB metric to MySQL plugin.
- [#2251](https://github.com/influxdata/telegraf/pull/2251): InfluxDB output: use own client for improved through-put and less allocations. - [#2251](https://github.com/influxdata/telegraf/pull/2251): InfluxDB output: use own client for improved through-put and less allocations.
- [#2330](https://github.com/influxdata/telegraf/pull/2330): Keep -config-directory when running as Windows service.
- [#1900](https://github.com/influxdata/telegraf/pull/1900): Riemann plugin rewrite. - [#1900](https://github.com/influxdata/telegraf/pull/1900): Riemann plugin rewrite.
- [#1453](https://github.com/influxdata/telegraf/pull/1453): diskio: add support for name templates and udev tags. - [#1453](https://github.com/influxdata/telegraf/pull/1453): diskio: add support for name templates and udev tags.
- [#2277](https://github.com/influxdata/telegraf/pull/2277): add integer metrics for Consul check health state. - [#2277](https://github.com/influxdata/telegraf/pull/2277): add integer metrics for Consul check health state.

View File

@ -327,6 +327,9 @@ func main() {
if *fConfig != "" { if *fConfig != "" {
(*svcConfig).Arguments = []string{"-config", *fConfig} (*svcConfig).Arguments = []string{"-config", *fConfig}
} }
if *fConfigDirectory != "" {
(*svcConfig).Arguments = append((*svcConfig).Arguments, "-config-directory", *fConfigDirectory)
}
err := service.Control(s, *fService) err := service.Control(s, *fService)
if err != nil { if err != nil {
log.Fatal("E! " + err.Error()) log.Fatal("E! " + err.Error())