How to reload sysctl.conf

Last updated on July 5, 2020 by Dan Nanni

Linux kernel provides a sysctl interface for examining and modifying kernel parameters in the userspace. The existing kernel parameters are listed under /proc/sys directory, and they can dynamically enable or disable various kernel features (e.g., IPv6, IP forwarding, automatic reboot, etc).

While you can change the kernel parameters via /proc interface, such change does not survive reboots. Alternatively, you can set or change the kernel parameters via /etc/sysctl.conf file, and the configurations defined in /etc/sysctl.conf remain permanent across reboots.

If you have modified /etc/sysctl.conf, that change does not get activated until you reboot your system. If you want to activate the change in the kernel immediately without rebooting, you need to explictly reload sysctl.conf into the kernel as follows.

On FreeBSD:

$ sudo /etc/rc.d/sysctl reload

On Linux:

$ sudo sysctl -p /etc/sysctl.conf 

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean