Skip to content

Commit

Permalink
Remove mlock warning when mlock is explicitly disabled (#3979)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored and jefferai committed Feb 14, 2018
1 parent 3c1c809 commit ee4327d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,10 @@ func (c *ServerCommand) Run(args []string) int {
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.
if !c.flagDev && !mlock.Supported() {
// 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.
if !c.flagDev && !config.DisableMlock && !mlock.Supported() {
c.UI.Warn(wrapAtLength(
"WARNING! mlock is not supported on this system! An mlockall(2)-like " +
"syscall to prevent memory from being swapped to disk is not " +
Expand Down

0 comments on commit ee4327d

Please sign in to comment.