Repository navigation
Apply sysctl with full sysctl.d precedence - #104
Merged
Merged
Conversation
sysctl -p reads a single file, so reloading 50-incus-deploy.conf sets values that a higher-numbered drop-in is meant to override. The live kernel then disagrees with what a reboot would produce. Defer the reload and run sysctl --system once after the files are in place. Signed-off-by: Stephan Peijnik-Steinwender <speijnik@eoscloud.io>
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.
ansible.posix.sysctlwithreload: truerunssysctl -p <sysctl_file>, whichapplies that one file in isolation. Writing
/etc/sysctl.d/50-incus-deploy.conftherefore pushes these values into the running kernel even where a
higher-numbered drop-in is meant to override them, so the live values disagree
with what a reboot would produce.
Observed on a host where
/usr/lib/sysctl.d/55-map-count.confsetsvm.max_map_count=1048576and a Ceph drop-in setsfs.aio-max-nr=2097152.After a run the kernel reported the
50-incus-deploy.confvalues:A plain
sysctl --systemrestored the intended ones:Defer the reload and run
sysctl --systemonce from a handler, so the appliedstate matches the file precedence.
meta: flush_handlerskeeps the values livefor the roles that run afterwards rather than deferring them to the end of the
play. Also replaces eleven
sysctl -pinvocations with one.