Some of my colleagues added or updated kernel parameters using the sysctl command. Now, I want to make them persistent before restarting the server for upgrades. Is there any way I can find these changes and make them persistent?
The easiest way would be to just check shell history and extract the relevant sysctl commands and add the parameters to /etc/sysctl.conf ; Of course, if the history is expired or scattered across time or multiple accounts and shell sessions, this isn't practical and may not be possible.
If good system administration practices were used to set these kernel parameters, such as using sudo for single commands and putting the parameters on the sysctl command line, you might be able to extract them from the sudo logs.
Both of those failing, your next chance would be to use sysctl -a
to dump the current values to a file, reboot the system (or compare to a near identical system), and then use diff (or some other similar tool) to compare the output from before and after the reboot, and then save (and reapply) the differences to /etc/sysctl.conf