diff --git a/addons/redis-server-ubuntu.sh b/addons/redis-server-ubuntu.sh index ecb8c0c968..31b9d58545 100644 --- a/addons/redis-server-ubuntu.sh +++ b/addons/redis-server-ubuntu.sh @@ -70,10 +70,9 @@ phpenmod -v "$PHPVER" redis install_if_not redis-server ## Redis performance tweaks ## -if ! grep -Fxq "vm.overcommit_memory = 1" /etc/sysctl.conf -then - echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf -fi +# /etc/sysctl.conf isn't read at boot on Ubuntu 26.04, so use sysctl.d +echo 'vm.overcommit_memory = 1' > /etc/sysctl.d/90-redis.conf +sysctl -w vm.overcommit_memory=1 # Disable THP if ! grep -Fxq "never" /sys/kernel/mm/transparent_hugepage/enabled diff --git a/apps/smbmount.sh b/apps/smbmount.sh index 4987b09d5b..0274c5111d 100644 --- a/apps/smbmount.sh +++ b/apps/smbmount.sh @@ -331,7 +331,7 @@ If you choose 'yes', we will install a needed PHP-plugin, the files_inotify app Please note, that this will need around 1 KB additional RAM per folder. We will set the max folder variable to 524288 which will be around \ 500 MB of additionally needed RAM if you have so many folders. -If you have more folders, you will need to raise this value manually inside '/etc/sysctl.conf'. +If you have more folders, you will need to raise this value manually inside '/etc/sysctl.d/90-inotify.conf'. Please also note, that this max folder variable counts for \ all external storages for which the inotify option gets activated. We please you to do the math yourself if the number is high enough for your setup." @@ -380,11 +380,11 @@ We please you to do the math yourself if the number is high enough for your setu # Set fs.inotify.max_user_watches to 524288 # https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached # https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers - if ! grep -q "fs.inotify.max_user_watches" /etc/sysctl.conf + if ! grep -qs "fs.inotify.max_user_watches" /etc/sysctl.d/90-inotify.conf then print_text_in_color "$ICyan" "Setting the max folder variable to 524288..." - echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf - sudo sysctl -p + echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/90-inotify.conf + sudo sysctl -p /etc/sysctl.d/90-inotify.conf fi # Create syslog for files_inotify diff --git a/lib.sh b/lib.sh index 16af9f5cc3..9307b76f67 100644 --- a/lib.sh +++ b/lib.sh @@ -1762,15 +1762,15 @@ fi } set_max_count() { -if grep -F 'vm.max_map_count=512000' /etc/sysctl.conf ; then +# /etc/sysctl.conf isn't read at boot on Ubuntu 26.04, so use sysctl.d +if grep -Fqs 'vm.max_map_count=512000' /etc/sysctl.d/90-max_map_count.conf ; then print_text_in_color "$ICyan" "Max map count already set, skipping..." else sysctl -w vm.max_map_count=512000 { - echo "###################################################################" echo "# Docker ES max virtual memory" echo "vm.max_map_count=512000" - } >> /etc/sysctl.conf + } > /etc/sysctl.d/90-max_map_count.conf fi } diff --git a/nextcloud_update.sh b/nextcloud_update.sh index c4ea49416b..a8c829412f 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -529,6 +529,12 @@ else fi fi +# /etc/sysctl.conf isn't read at boot on Ubuntu 26.04, but older scripts saved settings there +if [ -f /etc/sysctl.conf ] && [ ! -e /etc/sysctl.d/99-sysctl.conf ] +then + ln -s ../sysctl.conf /etc/sysctl.d/99-sysctl.conf +fi + # Remove APCu https://github.com/nextcloud/vm/issues/2039 if is_this_installed "php$PHPVER"-dev then diff --git a/not-supported/smbserver.sh b/not-supported/smbserver.sh index 4f04f389f2..d540717132 100644 --- a/not-supported/smbserver.sh +++ b/not-supported/smbserver.sh @@ -898,7 +898,7 @@ If you choose 'yes', we will install a needed PHP-plugin, the files_inotify app Please note, that this will need around 1 KB additional RAM per folder. We will set the max folder variable to 524288 which will be around 500 MB \ of additionally needed RAM if you have so many folders. -If you have more folders, you will need to raise this value manually inside '/etc/sysctl.conf'. +If you have more folders, you will need to raise this value manually inside '/etc/sysctl.d/90-inotify.conf'. Please also note, that this max folder variable counts for all \ external storages for which the inotify option gets activated. We please you to do the math yourself if the number is high enough for your setup." @@ -928,11 +928,11 @@ We please you to do the math yourself if the number is high enough for your setu # Set fs.inotify.max_user_watches to 524288 # https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached # https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers - if ! grep -q "fs.inotify.max_user_watches" /etc/sysctl.conf + if ! grep -qs "fs.inotify.max_user_watches" /etc/sysctl.d/90-inotify.conf then print_text_in_color "$ICyan" "Setting the max folder variable to 524288..." - echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf - sudo sysctl -p + echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/90-inotify.conf + sudo sysctl -p /etc/sysctl.d/90-inotify.conf fi # Create syslog for files_inotify