Allow running as console application on Windows (#2754)

This commit is contained in:
Logan 2018-01-25 16:04:09 -07:00 committed by Daniel Nelson
parent f9c0aa1e23
commit d831dbc51d
2 changed files with 3 additions and 1 deletions

View File

@ -465,6 +465,7 @@ be deprecated eventually.
### Bugfixes ### Bugfixes
- [#2754](https://github.com/influxdata/telegraf/pull/2754): allow running as console application on Windows
- [#2633](https://github.com/influxdata/telegraf/pull/2633): ipmi_sensor: allow @ symbol in password - [#2633](https://github.com/influxdata/telegraf/pull/2633): ipmi_sensor: allow @ symbol in password
- [#2077](https://github.com/influxdata/telegraf/issues/2077): SQL Server Input - Arithmetic overflow error converting numeric to data type int. - [#2077](https://github.com/influxdata/telegraf/issues/2077): SQL Server Input - Arithmetic overflow error converting numeric to data type int.
- [#2262](https://github.com/influxdata/telegraf/issues/2262): Flush jitter can inhibit metric collection. - [#2262](https://github.com/influxdata/telegraf/issues/2262): Flush jitter can inhibit metric collection.

View File

@ -54,6 +54,7 @@ var fUsage = flag.String("usage", "",
"print usage for a plugin, ie, 'telegraf --usage mysql'") "print usage for a plugin, ie, 'telegraf --usage mysql'")
var fService = flag.String("service", "", var fService = flag.String("service", "",
"operate on the service") "operate on the service")
var fRunAsConsole = flag.Bool("console", false, "run as console application (windows only)")
var ( var (
nextVersion = "1.6.0" nextVersion = "1.6.0"
@ -358,7 +359,7 @@ func main() {
return return
} }
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" && !(*fRunAsConsole) {
svcConfig := &service.Config{ svcConfig := &service.Config{
Name: "telegraf", Name: "telegraf",
DisplayName: "Telegraf Data Collector Service", DisplayName: "Telegraf Data Collector Service",