hashicorp / boundary

Boundary enables identity-based access management for dynamic infrastructure.
https://boundaryproject.io
Other
3.84k stars 287 forks source link

Unable to run Boundary Server has Windows Service #3358

Open allynl93 opened 1 year ago

allynl93 commented 1 year ago

Deploying a worker on a Windows device is a valid setup, but I cannot find any documentation on how to run the executable as a Windows Service.

I completed the following to create the service:

sc.exe Create Boundary binPath= '"D:\Boundary\boundary.exe" Server -config="D:\Boundary\pki-worker.hcl"'

The service was created successfully but when I try and start the service I receive an error:

"Error 1053: The service did not respond to the start or control request in a timely manner".

Perhaps I am missing a flag? But the documentation is lacking in this area. Support made an article for Linux hosts but didn't include Windows.

macmiranda commented 1 year ago

A quick google search yields: https://stackoverflow.com/questions/3582108/create-windows-service-from-executable Have you tried that one?

allynl93 commented 1 year ago

I used the default Windows tool sc.exe yes.

macmiranda commented 1 year ago

I actually meant http://nssm.cc/

1Rost commented 10 months ago

I actually meant http://nssm.cc/

But why Vault by HashiCorp can use default sc.exe without any second-party apps? https://developer.hashicorp.com/vault/tutorials/vault-agent/agent-windows-service#register-vault-agent-as-a-windows-service

johanbrandhorst commented 7 months ago

To support this Boundary would need to implement the Windows Service Manager syscall event loop. There is no support for this at the moment, but a user could theoretically write their own wrapper around the Boundary binary to implement the expected API and just manage the process. https://pkg.go.dev/golang.org/x/sys/windows/svc is a package that can help do this in Go.