Environment: Gentoo with openrc init system but this might also (partly) be true for systemd. Symptom: After configuring vault the service immediately crashes after "/etc/init.d/vault start". The logs say this: """ Error initializing core: Failed to lock memory: cannot allocate memory This usually means that the mlock syscall is not available. Vault uses mlock to prevent memory from being swapped to disk. This requires root privileges as well as a machine that supports mlock. Please enable mlock on your system or disable Vault from using it. To disable Vault from using it, set the `disable_mlock` configuration option in your configuration file. Error initializing core: Failed to lock memory: cannot allocate memory This usually means that the mlock syscall is not available. Vault uses mlock to prevent memory from being swapped to disk. This requires root privileges as well as a machine that supports mlock. Please enable mlock on your system or disable Vault from using it. To disable Vault from using it, set the `disable_mlock` configuration option in your configuration file. """ A look into the ebuild shows the following lines: """ FILECAPS=( -m 755 'cap_ipc_lock=+ei' usr/bin/${PN} ) """ The vault documentation https://www.vaultproject.io/docs/config/ sais: """ sudo setcap cap_ipc_lock=+ep $(readlink -f $(which vault)) """ So the ebuild should do: """ FILECAPS=( -m 755 'cap_ipc_lock=+ep' usr/bin/${PN} ) """ There is also a bug in the init.d template: """ command_args="agent -config-dir=/etc/vault.d ${command_args}" """ The command for starting the server is "server" not "agent". Also the "server" command does not know the argument "-config-dir". So this line should be: """ command_args="server ${command_args}" """
Thanks, I've applied your fixes: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05d7c50d3b5161217e4b21ea254fac4156705511 https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe2e87cdd9ba78e5ef089edb0f713f80091aa81f And I've bumped it version 0.5.3: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30d8354725d380f4c9703c25e3137de6d2833265