-
Notifications
You must be signed in to change notification settings - Fork 112
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
Run as Windows service is failing #141
Comments
I have same problem too. |
I first tried the same for not having to use the NSSM. The Problem with SC is that the Now I'm using a scheduled task to start the exporter after Windows startup with: ## ensure C:\it\nvidia_gpu_exporter.exe exists
$Trigger = New-ScheduledTaskTrigger -AtStartup
$Action = New-ScheduledTaskAction -Execute "C:\it\nvidia_gpu_exporter.exe"
$Principal = New-ScheduledTaskPrincipal -GroupId "NT AUTHORITY\LocalService"
Register-ScheduledTask -TaskName "nvidia_gpu_exporter" -Trigger $Trigger -Action $Action -Principal $Principal |
Hi everyone... @utkuozdemir @endresjo @lZzozZl @oblivian i create a fork, and use the "kardianos" go package, that is a "wrapper" to windows SVC and anothers "service" implemantations (mac, windows, linux, etc). I just "copy and paste" some code from another project that i use to work as "windows service". Im testing it, and its work as windows service , without use of nssm. If someone has interest, is in my master fork branch https://github.com/alexwbaule/nvidia_gpu_exporter (you can look the modifications at cmd/nvidia_gpu_exporter/main.go). If its ok, i can do a PR to merge it... (if someone test it too). To test, just build as usual. for my, i cross compile from my linux: |
@alexwbaule Thanks, this is something I wanted to do since a long time. Feel free to open the PR, but I cannot promise going over it anytime soon. I think it might get a bit tricky with the logger etc, so I would like to iterate on it myself before merging it too quickly. So, the PR is welcome, but it might take a long time till I get to it and eventually merge. In the meanwhile I suggest using your fork. |
@utkuozdemir it's Ok for me... I will do a PR , and we can test it, discuss, etc.. Tonight, when I come home I will do it. |
No rush pls :) |
Describe the bug
Failing when running as a Windows Service
Runs fine when ran from CLI.
To Reproduce
Produces:
Expected behavior
I was expecting it to work like most other "exporters" like windows_exporter where one simply use the above procedure.
I see nssm.exe is recommended, but it is long since abandon-ware and too many anti-viruses flag it as malicious to be trusted anymore.
Console output
Model and Version
The text was updated successfully, but these errors were encountered: