Explorar o código

Account for different paths for sysctl utilities

On some systems these utilities are in /usr/lib/systemd/systemd-sysctl
and /usr/sbin/sysctl, and on others the /usr is dropped. This commit
accounts for that fact.
Jason Tedor %!s(int64=9) %!d(string=hai) anos
pai
achega
404b9afeca

+ 2 - 0
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

+ 5 - 1
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