How to edit readonly sysctl.conf

Hi,
I need to edit some system variables. But I can not edit the readonly sysctl.conf file, although I use sudo command. I test it on ubuntu core 16. Or is there another way to edit system variables?

Thank you.

You should be able to drop files in /etc/sysctl.d, see sysctl.d manpage for details.

Thank you for your reply. It works.

If you don’t mind me asking, which parameter did you need to change?

We have landed some changes that will allow tweaking kernel.printk via snap set system .. and gadget detauls just recently, and I’m wondering what other settings people need to tweak.

well, it would be neat to be able to set sysctl values in general through a system config option to be able to set things for:
oom threshold, filesystem caching/flushing values, IO scheduler, network and firewall values as well as swappiness from the gadget for fine tuning the image towards specific hardware.

It would be great to be able to do something like:

snap set system network.ipv4-ip-forward=true

Not sure if we can already… I couldn’t find this anywhere.

Or be able to see what key-values we can set with

snap set system

The doc here is not listing all the options, for example no mention of valid network options.

see https://snapcraft.io/docs/system-options

Hi, that’s the same link I posted… hope it’s not a big miss on my side but I see no system.network.* options in there. I’m certain at least one exists i.e. .disable-ipv6, which would point to a gap in the documentation?

Also, the page references to the get system command to list key-value pairs that have been modified. What I meant above is that it would be nice to have something similar listing all available options, if feasible of course…

i think it is actually up to date, the experimental options are not listed, but they are typically temporary anyway.
(i think we simply crossed the streams with the two posts, i had not seen your link when i posted)