Add disable_mlock env support (#9931)

This commit is contained in:
Jason O'Donnell
2020-09-11 12:56:30 -04:00
committed by GitHub
parent dba37adcb5
commit 54d0ad7938

View File

@@ -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)
}
@@ -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.