-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add 'pid_file' config option #3321
Conversation
command/server.go
Outdated
@@ -50,6 +50,8 @@ import ( | |||
|
|||
// ServerCommand is a Command that starts the Vault server. | |||
type ServerCommand struct { | |||
Config *server.Config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary, why not just give the path to storePid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to clean up the pid file on clean shutdown. It looks like we create it but never remove it on shutdown.
@chrishoffman I'm now removing it on shutdown. |
command/server.go
Outdated
} | ||
|
||
// Open the PID file | ||
pidFile, err := os.OpenFile(pidPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These permissions are too open -- certainly the file should not be world-writable. I suggest 0644.
@@ -105,6 +105,9 @@ to specify where the configuration is. | |||
the standard Vault API address will automatically redirect there. This can also | |||
be provided via the environment variable `VAULT_UI`. | |||
|
|||
- `pid_file` `(string: "")` - Path to the file in which Vault server PID should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say "Path to the file in which the Vault server's Process ID (PID) should be stored."
Just in case people think PID is something Vault-y. You never know...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments, feel free to merge after.
No description provided.