use sysctl.d instead of /etc/sysctl.conf - #2857
Merged
Merged
Conversation
Ubuntu 26.04 ships neither /etc/sysctl.conf nor the /etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf link that 24.04 has, and systemd-sysctl only reads sysctl.d at boot. The settings the scripts append to /etc/sysctl.conf (vm.overcommit_memory for Redis, vm.max_map_count for Elasticsearch, fs.inotify.max_user_watches for files_inotify) are therefore lost at the first reboot on 26.04. Write each setting to its own file in /etc/sysctl.d instead, which every Ubuntu release reads. On existing VMs where a script created /etc/sysctl.conf, the updater restores the 99-sysctl.conf link so that those settings (and any added by hand) apply again.
enoch85
force-pushed
the
fix/sysctl-d
branch
from
September 26, 2026 14:55
fa35cfc to
e66529c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Ubuntu 26.04 the kernel settings the scripts save to
/etc/sysctl.confare never applied at boot:vm.overcommit_memory = 1for Redis, on every new VMvm.max_map_countfor Elasticsearch (Full Text Search)fs.inotify.max_user_watchesfor files_inotify (SMB mount, SMB server)Root cause: 24.04 ships
/etc/sysctl.confand the/etc/sysctl.d/99-sysctl.conf -> ../sysctl.conflink. 26.04 ships neither, and systemd-sysctl only readssysctl.d. The scripts create/etc/sysctl.conf, but nothing reads it.Fix:
/etc/sysctl.d/90-*.conf, which every Ubuntu release reads, and apply it right away.99-sysctl.conflink when/etc/sysctl.confexists without it, so settings older scripts (or admins) put there apply again.Existing installs: fixed by the next update. 24.04 VMs already have the link, so nothing changes there.
Verified on an Ubuntu 26.04 test container (fresh install of this branch):
/etc/sysctl.confis no longer created, andsystemd-analyze cat-config sysctl.dshows/etc/sysctl.d/90-redis.confwithvm.overcommit_memory = 1, also after a reboot./etc/sysctl.confline and no link,update.sh minorcreated/etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf.🤖 AI (if applicable)
Assisted-by: ClaudeCode:claude-opus-5-5