Skip to content
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

Open
easymoney322 opened this issue Sep 5, 2023 · 2 comments
Open

Feature request: Windows Service mode #163

easymoney322 opened this issue Sep 5, 2023 · 2 comments

Comments

@easymoney322
Copy link

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.

@NiceGuyIT
Copy link
Member

How are you creating the service?

I wonder what other exporters use. 🤔 node_exporter recommends windows_exporter which uses an MSI for installation. dellhw_exporter uses sc.exe.

@easymoney322
Copy link
Author

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.
The service works fine for ~30s, before SCM kills it for not responding to the system calls.
This timeout is set at global level and can't be changed for any service individually.

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.
I'd suggest reading this golang/go#23479

How are you creating the service?

I wonder what other exporters use. 🤔 node_exporter recommends windows_exporter which uses an MSI for installation. dellhw_exporter uses sc.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants