]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/oom/meson.build
meson: add build option for install path of main config files
authorFranck Bui <fbui@suse.com>
Mon, 21 Aug 2023 10:37:00 +0000 (12:37 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Oct 2023 16:57:45 +0000 (18:57 +0200)
commit6495361c7d5e8bf640841d1292ef6cfe1ea244cf
tree2aa0b18862588ec5c7dee736bef092d94b9f4487
parentee691c802b8347ab8f7066d52814b8d05faa6dc0
meson: add build option for install path of main config files

This allows distros to install configuration file templates in /usr/lib/systemd
for example.

Currently we install "empty" config files in /etc/systemd/. They serve two
purposes:

- The file contains commented-out values that show the default settings.
- It is easier to edit the right file if it is already there, the user doesn't
  have to type in the path correctly, and the basic file structure is already in
  place so it's easier to edit.

Things that have happened since this approach was put in place:

- We started supporting drop-ins for config files, and drop-ins are the
  recommended way to create local configuration overrides.
- We have systemd-analyze cat-config which takes care of iterating over
  all possible locations (/etc, /run, /usr, /usr/local) and figuring out
  the right file.
- Because of the first two points, systemd-analyze cat-config is much better,
  because it takes care of finding all the drop-ins and figuring out the
  precedence. Looking at files manually is still possible of course, but not
  very convenient.

The disadvantages of the current approach with "empty" files in /etc:

- We clutter up /etc so it's harder to see what the local configuration actually is.
- If a user edits the file, package updates will not override the file (e.g.
  systemd.rpm uses %config(noreplace). This means that the "documented defaults"
  will become stale over time, if the user ever edits the main config file.

Thus, I think that it's reasonable to:

- Install the main config file to /usr/lib so that it serves as reference for
  syntax and option names and default values and is properly updated on package
  upgrades.
- Recommend to users to always use drop-ins for configuration and
  systemd-analyze cat-config to view the documentation.

This setting makes this change opt-in.

Fixes #18420.

[zjs: add more text to the description]
15 files changed:
meson.build
meson_options.txt
src/core/meson.build
src/coredump/meson.build
src/home/meson.build
src/journal-remote/meson.build
src/journal/meson.build
src/login/meson.build
src/network/meson.build
src/oom/meson.build
src/pstore/meson.build
src/resolve/meson.build
src/sleep/meson.build
src/timesync/meson.build
src/udev/meson.build