When should sysctl be run during boot?

Jonathan Underwood jonathan.underwood at gmail.com
Sat Sep 29 22:48:25 UTC 2007


Hi,

Currently, values set in /etc/sysctl.conf are set on boot when sysctl
-p -e is called. This happens in /etc/network. Of course, setting
values for kernel modules not loaded at that point has no effect.

This caught me out recently, as I tried to set a value for one of the
conntrack modules. Because the relevant module wasn't loaded until
shorewall started on my system, and because shorewall is started after
the network, the setting didn't do anything. The way I fixed it is by
adding sysctl -e -p to rc.local, so that it is ran after all the other
init scripts. However, I could see that this approach might be unwise
since the nfs script uses sysctl to change some values, and
potentially that could be undone by bad settings in sysctl.conf.

My question then is: should there not be a service that runs sysctl on
boot, as the last thing before rc.local? I have seen this on other
distributions. This would make the following statement true: If you
want to make a change to /proc/sys persistent across reboots, then add
it to /etc/sysctl.conf. It currently isn't always true due to the
timing of systl being run, but that statement is, for many, expected
behaviour.

Thoughts?

Jonathan.




More information about the fedora-devel-list mailing list