On 19/12/24 08:17, Frank Guthausen wrote:
A lot of packages do default configuration in /etc/project.conf and
admin related stuff in /etc/project.d/whatsoever.conf to separate the
distribution part from local overrides.
Hi,
this is what can be called "old style" overrides.
The modern way of doing it is the "stateless" style, most commonly
associated with systemd but used by plenty of other projects, plus
"drop-in" .d directories.
The basic documentation can be found at
<https://uapi-group.org/specifications/specs/configuration_files_specification/>.
libeconf provides an implementation of the spec and its details.
Simply speaking the stateless style works like this:
* Distro/upstream configuration in /usr/lib/$proj/foo.conf (read-only)
* Admin can override the standard configuration via /etc/$proj/foo.conf
* Runtime overrides can be placed in /run/$proj/foo.conf
* User can override admin's and upstream's config via
$HOME/.config/$proj/foo.conf
* User's runtime overrides can be placed in $XDG_RUNTIME_DIR/$proj/foo.conf
In addition, snippets that add or override only part of the
configuration can be loaded from
{/usr/lib,/etc,/run,$HOME/.config}/$proj/foo.conf.d/extra1.conf
Upstream projects are moving to this style. I hope that one day Debian
packages will stop shipping files under /etc.
Regards,
--
Gioele Barabucci