diff options
author | Franck Bui <fbui@suse.com> | 2023-08-21 12:37:00 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-10-17 18:57:45 +0200 |
commit | 6495361c7d5e8bf640841d1292ef6cfe1ea244cf (patch) | |
tree | 2aa0b18862588ec5c7dee736bef092d94b9f4487 /meson_options.txt | |
parent | Merge pull request #29242 from fbuihuu/update-main-config-file-headers (diff) | |
download | systemd-6495361c7d5e8bf640841d1292ef6cfe1ea244cf.tar.xz systemd-6495361c7d5e8bf640841d1292ef6cfe1ea244cf.zip |
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]
Diffstat (limited to 'meson_options.txt')
-rw-r--r-- | meson_options.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meson_options.txt b/meson_options.txt index b8116bcedd..831d23e299 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -210,7 +210,9 @@ option('libcryptsetup-plugins-dir', type : 'string', option('docdir', type : 'string', description : 'documentation directory') option('install-sysconfdir', type : 'combo', choices : ['true', 'no-samples', 'false'], value : 'true', - description : 'install configuration files and directories to $sysconfdir') + description : 'install configuration files and directories') +option('configfiledir', type : 'string', value : '', + description : 'directory for configuration files') option('fallback-hostname', type : 'string', value : 'localhost', description : 'the hostname used if none configured') |