[pulseaudio-discuss] [PATCH v2 1/2] conf-parser: add support for .d directories

David Henningsson david.henningsson at canonical.com
Sun Dec 6 23:44:00 PST 2015



On 2015-12-04 13:46, Tanu Kaskinen wrote:
> On Fri, 2015-12-04 at 09:29 -0300, Felipe Sateler wrote:
>> On 4 December 2015 at 02:58, Tanu Kaskinen <tanuk at iki.fi> wrote:
>>> + * If use_dot_d is true, then before parsing the file named by the filename
>>> + * argument, the function will parse all files ending with ".conf" in
>>> + * alphabetical order from a directory whose name is filename + ".d", if such
>>> + * directory exists.
>>
>> This is opposite to how other software (eg systemd) work: first the
>> main file is read, and then the .d/*.conf files are read to override
>> the configurations.
>>
>> So if a distro default has an uncommented line, the .d should override
>> that line. This would allow (in the future) to extend the search path
>> to /usr/share/pulseaudio, and ship the defaults (uncommented) there.
>> Then local configuration can be done via dropin files.
>
> All advice given to users so far has been to modify the main files,
> because nothing else has existed. If users put their changes to the
> main files and distros put their changes to the .d files, that will be
> compatible with existing advice on the internet.

As an additional data point, I looked at pam 
(/etc/security/limits.{conf|.d/*.conf}, which (if I'm reading the code 
correctly) does the same as systemd, i e, /etc/security/limits.conf 
being the default, and then /etc/security/limits.d/*.conf overriding that.

If the config file has been given explicitly (not a problem for us now, 
but would be if we ever replace default.pa with this), then the .d files 
are skipped.

My opinion: In the long term, I think it would be a bigger advantage to 
be consistent with other common software, compared to the advantage of 
being compatible with existing advice. We could also add a comment 
saying this in the main .conf file.

Hence we end up with the following order:

/etc/pulse/daemon.conf
/etc/pulse/daemon.d/*.conf
~/.config/pulse/daemon.conf
~/.config/pulse/daemon.d/*.conf

...current documentation states that "If the version in the user's home
directory does not exist the global configuration file is loaded.", or 
put it in another way, we skip loading the global file completely if the 
user specific file is present. Is this desired behavior or should we 
merge all four files in priority order?

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list