-
Notifications
You must be signed in to change notification settings - Fork 691
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
How to set Start Parameter in windows service #75
Comments
Use configuration file or pass args on install. On Tue, Oct 18, 2016, 03:51 Vigneshr6 [email protected] wrote:
|
The link you gave is not valid for my account. Can u give me the Sample code? |
I used your logging program to run my go application as a service in windows. |
Github issues is not really a place to ask for help with writing your code. They are to report problems with the product. You might be better go and check stackoverflow.com or ask the question there. |
Or the library could pass the start arguments instead of ignoring them: #82 :)
I think it is the right place when the confusion is partly caused by a missing feature. |
To configure service to run an executable with a given set of arguments, set https://godoc.org/github.com/kardianos/service#Config.Arguments to the arguments before install. Then when it is started the windows service manager will pass those arguments to the executable. To access them at runtime you should use https://golang.org/pkg/os/#Args . Please let me know if this answers your questions. |
Yes This is what I asked for |
@kardianos thanks for the answer. When given arguments in the config, the service starts and those args get passed to the service. What do I need to do now if I need to control a running service? Do I need to create another service instance via Service.new(), passing in the same config with the arguments given on start? Or does it just need the name of the Service? Thanks a lot for your help! |
My Application have to get http port to run.
I have to set the port number in windows start parameter
The text was updated successfully, but these errors were encountered: