does /etc/sysctl.d/ really obeyed and does really override /etc/sysctl.conf

Przemek Klosowski przemek.klosowski at nist.gov
Fri Mar 16 17:31:00 UTC 2012


> On Fri, Mar 16, 2012 at 2:47 PM, Lennart Poettering wrote:

>> /etc/sysctl.conf is interpreted after /etc/sysctl.d is. The former hence
>> overrides settings in the latter.

and Muayyad AlSadi responded:
 > but this does not make sense
 >
 > the idea behind all .d is to allow packages to provide default (either
 > kernel defaults or distro defaults)
 > because the other choice is to use %post and sed

The setup of conf/oneBigFile + conf.d/manySmallFiles is so common (see 
the list of them on my system, below) that maybe there should be a 
convention on which one overrides which. Most of the packages using this 
configuration method are configured by reading oneBigFile, which then 
explicitly loads conf.d/*. In other cases, both configuration methods 
seem to be compiled in, and it is not clear which one is done first and 
thus possibly overridden.

The override order is determined by whether the changes are before or 
after the conf.d/* invocation. If the conf.d/* load is in the beginning 
of oneBigFile's contents, the settings from the conf.d/* files are 
overridden. This is how sysctl.conf behaves.

It makes more sense to me that files in conf.d override the main file, 
e.g. because they are loaded at the end of the oneBigFile. I prefer this 
behavior because the individual files in conf.d/ directory can be 
provided by optional components, which, in this scheme, don't have to 
touch the main config file.


/etc/httpd/conf.d
/etc/php.d
/etc/dracut.conf.d
/etc/ld.so.conf.d
/etc/prelink.conf.d
/etc/reader.conf.d
/etc/X11/xorg.conf.d
/etc/dracut.conf.d/01-dist.conf
/etc/fonts/conf.d
/etc/polkit-1/localauthority.conf.d
/etc/polkit-1/nullbackend.conf.d
/etc/reader.conf.d
/etc/revisor/conf.d
/etc/revisor-unity/conf.d
/etc/yum/pluginconf.d
/usr/share/X11/xorg.conf.d
/usr/share/alsa/alsa.conf.d
/usr/share/ghostscript/conf.d


More information about the devel mailing list