Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I couldn't find an answer in the man pages for sysctl. My sysctl.conf file is still at it's default state, I'm testing several values and loaded new settings via sysctl -p newsettings.conf. I though it would be sufficient for reseting to do sysctl -p (which means that it reads the values from sysctl.conf). But a fast sysctl -a | grep domain revealed that there are still the old settings.

Any ideas?

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

As far as I know there is no "undo" for sysctl -- You need to re-enter the default settings (typically /etc/sysctl.conf simply does not specify defaults, so re-reading it won't revert your changes unless there's an explicit setting).

If you do not know your default settings a reboot will get them back, and you can then list them with sysctl -a (store this somewhere for reference). If you have another mostly-identical machine around you can grab the sysctl -a output from that host instead of rebooting.

share|improve this answer
    
Okay, thanks. Rebooting would be a possibility and then sysctl -a > sysctl_defaults.conf should do the trick. I'll leave this open for some time, maybe somebody else knows a way. If not I'll accept your answer as the correct one. –  Fleshgrinder Aug 15 '12 at 20:42
    
@Fleshgrinder Make sure you're storing the sysctl values somewhere where they aren't being routinely read at boot (like ~/sysctl_defaults.conf) -- Though it doesn't happen often sometimes the default value for a given sysctl knob changes, and you could introduce some accidental strangeness that way. –  voretaq7 Aug 15 '12 at 20:59
    
Thanks, I knew that and I stored them in my home directory as you have proposed. I also made sure that nothing is in /etc/sysctl.d before rebooting. Everything worked like a charm and I think your solution is totally fine. Thanks again for your help. –  Fleshgrinder Aug 15 '12 at 21:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.