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 ed6c59bf97
commit 1e5ee780e5
2 changed files with 3 additions and 1 deletions

View File

@ -465,6 +465,7 @@ be deprecated eventually.
### 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
- [#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.

View File

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