mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03: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 New Issue
Block a user