mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
nixos/elasticsearch: Do not try to run sysctl if running in container, since it fails
This commit is contained in:
parent
c0ce917c77
commit
2fd11b762f
|
@ -174,11 +174,13 @@ in {
|
|||
LimitNOFILE = "1024000";
|
||||
};
|
||||
preStart = ''
|
||||
# Only set vm.max_map_count if lower than ES required minimum
|
||||
# This avoids conflict if configured via boot.kernel.sysctl
|
||||
if [ `${pkgs.procps}/bin/sysctl -n vm.max_map_count` -lt 262144 ]; then
|
||||
${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144
|
||||
fi
|
||||
${optionalString (!config.boot.isContainer) ''
|
||||
# Only set vm.max_map_count if lower than ES required minimum
|
||||
# This avoids conflict if configured via boot.kernel.sysctl
|
||||
if [ `${pkgs.procps}/bin/sysctl -n vm.max_map_count` -lt 262144 ]; then
|
||||
${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144
|
||||
fi
|
||||
''}
|
||||
|
||||
mkdir -m 0700 -p ${cfg.dataDir}
|
||||
|
||||
|
|
Loading…
Reference in a new issue