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

Run as Windows service is failing #141

Open
oblivian opened this issue Feb 17, 2024 · 2 comments
Open

Run as Windows service is failing #141

oblivian opened this issue Feb 17, 2024 · 2 comments

Comments

@oblivian
Copy link

Describe the bug
Failing when running as a Windows Service
Runs fine when ran from CLI.

To Reproduce

sc create nvidia_gpu_exporter binpath= "C:\Program Files\SysAdm\nvidia_gpu_exporter.exe"
sc start nvidia_gpu_exporter

Produces:

[SC] StartService FAILED 1053:
The service did not respond to the start or control request in a timely fashion.

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

[SC] StartService FAILED 1053:
The service did not respond to the start or control request in a timely fashion.

Model and Version

  • GPU Model: GeForce RTX 2080
  • App version and architecture: v1.2.0 - Win_x86_64
  • Installation method: binary download
  • Operating System: Windows 10
  • Nvidia GPU driver version: Windows Game Ready Driver 551.23
@lZzozZl
Copy link

lZzozZl commented Mar 22, 2024

I have same problem too.
I would like to use SC to install and run the service

@endresjo
Copy link

endresjo commented Nov 21, 2024

I first tried the same for not having to use the NSSM. The Problem with SC is that the nvidia_gpu_exporter.exe is not a "true" Windows service application (it does not implement the Windows Services API.

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

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

3 participants