initiate: fix Cannot create another system semaphore error (#1653)

This commit is contained in:
Jan-Otto Kröpke
2024-09-28 19:53:12 +02:00
committed by GitHub
parent a1defadf1e
commit b67b930ffc
2 changed files with 60 additions and 30 deletions

View File

@@ -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 {