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

use IsWindowsService to detect if running as service #863

Merged

Conversation

jsturtevant
Copy link
Contributor

Fixes: #856

When working on #581 (comment) I got the error time="2021-11-05T00:18:54Z" level=error msg="Failed to start service: The service process could not connect to the service controller." source="exporter.go:337"

It was not running as a service so it should not fall into this code path. I found https://pkg.go.dev/golang.org/x/sys/windows/svc#IsAnInteractiveSession was depreciated so made the switch.

@jsturtevant jsturtevant requested a review from a team as a code owner November 5, 2021 17:15
Signed-off-by: James Sturtevant <jstur@microsoft.com>
Copy link
Collaborator

@carlpett carlpett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@carlpett carlpett merged commit ce3d517 into prometheus-community:master Nov 5, 2021
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
…ice-identification

use IsWindowsService to detect if running as service
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

Successfully merging this pull request may close these issues.

Replace IsAnInteractiveSession by IsWindowsService
2 participants