-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow running as console application on Windows #2754
Allow running as console application on Windows #2754
Conversation
👍 This is useful when one does not necessarily want to run telegraf as a stand-alone native service. It will essentially allow one to bypass telegraf running as a service so that it can be invoked by external applications. This change was primarily introduced in PR #1543. |
It seems to me that the absence of the |
@danielnelson I don't believe that the |
Got it. What do you think about the flag being |
I think the |
I have tested these changes on a recent version of master (5bac086). All appears well. @danielnelson mentioned the signaling. As far as I can see the exe is accepting signals. The process stops cleanly. You mentioned the reloadLoop. Is there anything else to test regarding that? |
cmd/telegraf/telegraf.go
Outdated
@@ -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("run-as-console", false, "run as console application (windows only)") | |||
|
|||
// Telegraf version, populated linker. | |||
// ie, -ldflags "-X main.version=`git describe --always --tags`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the usage string should be updated to contain the new console
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just rename the flag and we can merge.
@danielnelson Thanks. @MondayHopscotch updated the flag to |
Tests would pass if the branch was merged/rebased, looks like the failures are what needed fixed when we moved to Go 1.9. |
Required for all PRs:
Allow windows service to run as console application