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

Add disable_mlock env support #9931

Merged
merged 1 commit into from
Sep 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ type quiescenceSink struct {
t *time.Timer
}


func (q quiescenceSink) Accept(name string, level log.Level, msg string, args ...interface{}) {
q.t.Reset(100 * time.Millisecond)
}
Expand Down Expand Up @@ -944,6 +943,15 @@ func (c *ServerCommand) Run(args []string) int {

logProxyEnvironmentVariables(c.logger)

if envMlock := os.Getenv("VAULT_DISABLE_MLOCK"); envMlock != "" {
var err error
config.DisableMlock, err = strconv.ParseBool(envMlock)
if err != nil {
c.UI.Output("Error parsing the environment variable VAULT_DISABLE_MLOCK")
return 1
}
}

// If mlockall(2) isn't supported, show a warning. We disable this in dev
// because it is quite scary to see when first using Vault. We also disable
// this if the user has explicitly disabled mlock in configuration.
Expand Down