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

Michal Hlavinka mhlavink at redhat.com
Fri Mar 16 13:40:29 UTC 2012


On 03/16/2012 02:28 PM, Lennart Poettering wrote:
> On Fri, 16.03.12 14:54, Muayyad AlSadi (alsadi at gmail.com) wrote:
>
>> 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
>
>> eg. let's say I made a firewall package that needs to enable
>> forwarding, it would put it in a sysctl.d
>
> If a package places a sysctl file in /etc/sysctl.d/ then you can
> override it with /etc/sysctl.conf, hence everything is as it should, no?
> This whole logic is designed so that the admin's configuration always
> takes precedence over vendor configuration. Which is the right thing to
> do.
>
> That said, note that it's probably a good idea if packages stick their
> sysctl files in /usr/lib/sysctl.d instead, so that that users can use
> /etc/sysctl.d/ to override that. /etc/sysctl.conf is read mostly for
> compatibility reasons only.

As I understand it, Muayyad has different problem. Right now, the 
/etc/sysctl.conf we ship is not empty. It has several values set, one of 
them is sysrq=0 he used in his example. No one set this is value, it's 
just default value and yet, no package can change it by placing its file 
in /etc/sysctl.d This would work only if sysctl.conf is empty and all 
default configuration is moved to /etc/sysctl.d/00-systemdefault.conf

Michal



More information about the devel mailing list