mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Add disable_mlock env support (#9931)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user