Correctly reload files from /etc/sysctl.d/*

This commit is contained in:
the-sane 2020-11-07 12:17:54 -05:00 committed by GitHub
parent d5e7465dbf
commit 12fcc9e057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,7 @@ mapcount_once() {
# Sets vm.max_map_count to persist between reboots # Sets vm.max_map_count to persist between reboots
mapcount_persist() { mapcount_persist() {
if [ -d "/etc/sysctl.d" ]; then if [ -d "/etc/sysctl.d" ]; then
pkexec sh -c 'echo "vm.max_map_count = 16777216" >> /etc/sysctl.d/20-max_map_count.conf && sysctl -p' pkexec sh -c 'echo "vm.max_map_count = 16777216" >> /etc/sysctl.d/20-max_map_count.conf && sysctl --system'
else else
pkexec sh -c 'echo "vm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p' pkexec sh -c 'echo "vm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p'
fi fi
@ -465,7 +465,7 @@ mapcount_persist() {
mapcount_manual() { mapcount_manual() {
if [ -d "/etc/sysctl.d" ]; then if [ -d "/etc/sysctl.d" ]; then
# Newer versions of sysctl # Newer versions of sysctl
message info "To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.d/20-max_map_count.conf && sysctl -p'" message info "To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.d/20-max_map_count.conf && sysctl --system'"
else else
# Older versions of sysctl # Older versions of sysctl
message info "To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.conf && sysctl -p'" message info "To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.conf && sysctl -p'"