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";
|
LimitNOFILE = "1024000";
|
||||||
};
|
};
|
||||||
preStart = ''
|
preStart = ''
|
||||||
# Only set vm.max_map_count if lower than ES required minimum
|
${optionalString (!config.boot.isContainer) ''
|
||||||
# This avoids conflict if configured via boot.kernel.sysctl
|
# Only set vm.max_map_count if lower than ES required minimum
|
||||||
if [ `${pkgs.procps}/bin/sysctl -n vm.max_map_count` -lt 262144 ]; then
|
# This avoids conflict if configured via boot.kernel.sysctl
|
||||||
${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144
|
if [ `${pkgs.procps}/bin/sysctl -n vm.max_map_count` -lt 262144 ]; then
|
||||||
fi
|
${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
|
||||||
mkdir -m 0700 -p ${cfg.dataDir}
|
mkdir -m 0700 -p ${cfg.dataDir}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user