-
Notifications
You must be signed in to change notification settings - Fork 95
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
Feature request: Windows Service mode #163
Comments
How are you creating the service? I wonder what other exporters use. 🤔 |
I was creating it manually with PowerShell New-Service, and I think it doesn't really matter, since all the services are managed by Service Control Manager in the end. Windows_exporter works fine, is able to work as a service, and creates one during the installation. Same goes for OHM-Graphite. If I understood Microsoft's Docs correctly, support for an app to work as a service must be implemented in the executable itself. For C++ it would be made via "winsvc.h". I don't know how it can be implemented with Go language, as I have no experience with Go.
|
One fairly simple workaround for this (and a correct solution if some application you want to run doesn't implement Windows service protocol) would be using something like |
IMO NSSM (as well as winsw) should be a workaround where an app can't be modified to run as a service. The only correct solution (which would also decrease an ammount of third-party moving parts and would make an app self-contained) would be to use the system API itself. For C/C++ it would be winsvc.h. I made a quick search in google and it looks this is possible in golang too via func RegisterServiceCtrlHandlerEx Also, Im not sure if NSSM and WinSW release builds exist for an ARM architecture Windows deployments. |
I'd like to see support for the service mode in Windows.
Right now, if you just make service, Windows will kill (Error 7000) the process on timeout (Error 7009).
Im unable to use task scheduler on some systems due to unstabilites, like when TS just finishes the task right after the start.
Docker containers wont work on old systems,
And computer startup scripts are the only workarounds, but are harder to control remotely.
The text was updated successfully, but these errors were encountered: