diff --git a/distribution/src/main/packaging/scripts/postinst b/distribution/src/main/packaging/scripts/postinst index bb14975e63b1f..0d1b9952e177f 100644 --- a/distribution/src/main/packaging/scripts/postinst +++ b/distribution/src/main/packaging/scripts/postinst @@ -48,17 +48,8 @@ case "$1" in esac # to pick up /usr/lib/sysctl.d/elasticsearch.conf -if [ "${ES_SKIP_SET_KERNEL_PARAMETERS:-false}" == "false" ]; then - if command -v /usr/lib/systemd/systemd-sysctl > /dev/null; then - /usr/lib/systemd/systemd-sysctl - elif command -v /lib/systemd/systemd-sysctl > /dev/null; then - /lib/systemd/systemd-sysctl - fi -elif [ "$ES_SKIP_SET_KERNEL_PARAMETERS" == "true" ]; then - echo "skipping setting kernel parameters" -else - echo "unrecognized value [$ES_SKIP_SET_KERNEL_PARAMETERS] for ES_SKIP_SET_KERNEL_PARAMETERS; must [false] (default) or [true]" - exit 1 +if command -v systemctl > /dev/null; then + systemctl restart systemd-sysctl.service fi if [ "x$IS_UPGRADE" != "xtrue" ]; then diff --git a/docs/reference/setup/install/skip-set-kernel-parameters.asciidoc b/docs/reference/setup/install/skip-set-kernel-parameters.asciidoc index 56406fce98729..32faabc4b0894 100644 --- a/docs/reference/setup/install/skip-set-kernel-parameters.asciidoc +++ b/docs/reference/setup/install/skip-set-kernel-parameters.asciidoc @@ -1,2 +1,2 @@ NOTE: On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g., -`vm.max_map_count`); you can skip this by setting the environment variable `ES_SKIP_SET_KERNEL_PARAMETERS` to `true`. +`vm.max_map_count`); you can skip this by masking the systemd-sysctl.service unit.