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

Allow Vault Agent to run as a Windows service #10231

Merged
merged 11 commits into from
Nov 23, 2020
Merged

Allow Vault Agent to run as a Windows service #10231

merged 11 commits into from
Nov 23, 2020

Conversation

raskchanky
Copy link
Contributor

Closes #7609

@raskchanky raskchanky added this to the 1.7 milestone Nov 5, 2020
Copy link
Contributor

@calvn calvn left a comment

Choose a reason for hiding this comment

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

TIL. This is pretty cool, thanks for working on this!

One comment/suggestion but otherwise looks good.

type serviceWindows struct{}

func init() {
interactive, err := wsvc.IsAnInteractiveSession()
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this func is deprecated, and the recommendation is to use IsWindowsService instead. Found an example of the usage in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out IsWindowsService hasn't been released yet. I updated this PR to use it and it won't compile, even with go 1.15.4. I'm going to revert that change.

@calvn
Copy link
Contributor

calvn commented Nov 6, 2020

@raskchanky Looks like CI is not happy that the package is not vendored.

command/agent/winsvc/service_windows.go:6:2: cannot find package "golang.org/x/sys/windows/svc" in any of:
	/gopath/src/github.com/hashicorp/vault/vendor/golang.org/x/sys/windows/svc (vendor tree)
	/goroot/src/golang.org/x/sys/windows/svc (from $GOROOT)
	/gopath/src/golang.org/x/sys/windows/svc (from $GOPATH)

CHANGELOG.md Outdated
@@ -955,7 +960,7 @@ KNOWN ISSUES:
* OSS binaries of 1.5.1, 1.4.4, 1.3.8, and 1.2.5 were built without the Vault UI. Enterprise binaries are not affected.
* AWS IAM logins may return an error depending on the headers sent with the request.
For more details and a workaround, see the [1.2.5 Upgrade Guide](https://www.vaultproject.io/docs/upgrading/upgrade-to-1.2.5)

BUG FIXES:
* seal: (enterprise) Fix issue causing stored seal and recovery keys to be mistaken as sealwrapped values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for the spam in this file. My editor is configured to strip all trailing whitespace on save.

@raskchanky raskchanky merged commit a933eee into master Nov 23, 2020
@raskchanky raskchanky deleted the agent-windows branch November 23, 2020 22:24
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.

Unable to run Vault agent as a Windows service
2 participants