diff --git a/distribution/src/main/packaging/scripts/postinst b/distribution/src/main/packaging/scripts/postinst index 91042ffbf50..3d5eeeedd8f 100644 --- a/distribution/src/main/packaging/scripts/postinst +++ b/distribution/src/main/packaging/scripts/postinst @@ -54,6 +54,8 @@ esac # to pick up /usr/lib/sysctl.d/elasticsearch.conf 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 if [ "x$IS_UPGRADE" != "xtrue" ]; then diff --git a/qa/vagrant/src/test/resources/packaging/scripts/os_package.bash b/qa/vagrant/src/test/resources/packaging/scripts/os_package.bash index 21ce874971a..700c1c66185 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/os_package.bash +++ b/qa/vagrant/src/test/resources/packaging/scripts/os_package.bash @@ -123,7 +123,11 @@ verify_package_installation() { assert_file "/usr/lib/systemd/system/elasticsearch.service" f root root 644 assert_file "/usr/lib/tmpfiles.d/elasticsearch.conf" f root root 644 assert_file "/usr/lib/sysctl.d/elasticsearch.conf" f root root 644 - [[ $(sysctl vm.max_map_count) =~ "vm.max_map_count = 262144" ]] + if is_rpm; then + [[ $(/usr/sbin/sysctl vm.max_map_count) =~ "vm.max_map_count = 262144" ]] + else + [[ $(/sbin/sysctl vm.max_map_count) =~ "vm.max_map_count = 262144" ]] + fi fi if is_sysvinit; then