Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o/configstate/configcore: support snap set system swap.size=... (2.51) #10455

Merged
merged 4 commits into from Jun 29, 2021

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Jun 25, 2021

This is #9932 for 2.51 to allow a clean cherry pick of #10446

Add a handler for the system swap option which manipulates /etc/default/swapfile
and swapfile.service. This option works both with systemd around at runtime, and
without during the initrd for example when only the rootfs is available.

In order to properly handle this when the key is not set without running systemd
unnecessarily, we need to use GetPristine to indicate if the value was changed
or not.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
We want to make sure that the swap size is an even integer number of megabytes
and that it's not too small, and that it's not negative.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
….size

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Thanks to Maciej for spotting this.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared this with the original PR and it looks fine.

@mvo5 mvo5 merged commit bb5646a into snapcore:release/2.51 Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants