mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-20 03:36:36 +00:00
initiate: fix Cannot create another system semaphore error (#1653)
This commit is contained in:
12
exporter.go
12
exporter.go
@@ -39,7 +39,17 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Exit(run())
|
||||
exitCode := run()
|
||||
|
||||
// If we are running as a service, we need to signal the service control manager that we are done.
|
||||
if !initiate.IsService {
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
initiate.ExitCodeCh <- exitCode
|
||||
|
||||
// Wait for the service control manager to signal that we are done.
|
||||
<-initiate.StopCh
|
||||
}
|
||||
|
||||
func run() int {
|
||||
|
||||
Reference in New Issue
Block a user