summaryrefslogtreecommitdiffstats
path: root/man/systemd-sysusers.xml
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-12-03 17:06:06 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-09 17:57:41 +0100
commitec3917d2825a32ac14eec209e53c6c6d6cd2b0da (patch)
tree4cb864ec587e8b03d221a6de6daba4225fb2102b /man/systemd-sysusers.xml
parentsysusers: convert to conf_file_read() (diff)
downloadsystemd-ec3917d2825a32ac14eec209e53c6c6d6cd2b0da.tar.xz
systemd-ec3917d2825a32ac14eec209e53c6c6d6cd2b0da.zip
tmpfiles,sysusers: rework path argument handling
Previously, if given an absolute path, we would open the file, but when given a relative path, we'd attempt to search the directories. If the user wants to open a file from the search path, allowing paths is very confusing. E.g. with a path like 'sysusers/foo.conf', we'd try to open '/etc/sysusers.d/sysusers/foo.conf', '/run/sysusers.d/sysusers/foo.conf', …, and with '../foo.conf', we'd try to open '/etc/sysusers.d/../foo.conf', '/run/sysusers.d/../foo.conf', …. This just isn't useful, and in fact for a scheme like sysusers.d and tmpfiles.d where there we have a flat directory with config files, only searching for plain names can result in success. When a user specifies a relative path, it's more likely that they wanted to open some local file. OTOH, to correctly open a local file, e.g. one that they're just writing, this interface is also awkward, because something like '$PWD/file.conf' has to be used to open a file with a relative path. This patch changes the interface so that any path (i.e. an argument with "/") is used to open a file directly, and only plain basenames are used for searching. (Note that tpmfiles and sysusers are somewhat special here: their "config files" make sense without the other config and users are likely to want to test them without the other config. I was trying to do just that when writing a spec file for a package and attempting to convert the existing scripts to sysusers and tmpfiles. The same logic wouldn't apply for example to units or udev rules, because they generally can only be interpreted with the whole rest of config also available.)
Diffstat (limited to 'man/systemd-sysusers.xml')
-rw-r--r--man/systemd-sysusers.xml12
1 files changed, 6 insertions, 6 deletions
diff --git a/man/systemd-sysusers.xml b/man/systemd-sysusers.xml
index 548ce24e4e..895422779d 100644
--- a/man/systemd-sysusers.xml
+++ b/man/systemd-sysusers.xml
@@ -40,17 +40,17 @@
<citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
- <para>If invoked with no arguments, it applies all directives from all files found in the directories
+ <para>If invoked with no arguments, directives from the configuration files found in the directories
specified by
<citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>. When
invoked with positional arguments, if option <option>--replace=<replaceable>PATH</replaceable></option>
is specified, arguments specified on the command line are used instead of the configuration file
<replaceable>PATH</replaceable>. Otherwise, just the configuration specified by the command line
- arguments is executed. The string <literal>-</literal> may be specified instead of a filename to instruct
- <command>systemd-sysusers</command> to read the configuration from standard input. If the argument is a
- relative path, all configuration directories are searched for a matching file and the file found that has
- the highest priority is executed. If the argument is an absolute path, that file is used directly without
- searching of the configuration directories.</para>
+ arguments is executed. If the string <literal>-</literal> is specified instead of a filename, the
+ configuration is read from standard input. If the argument is a file name (without any slashes), all
+ configuration directories are searched for a matching file and the file found that has the highest
+ priority is executed. If the argument is a path, that file is used directly without searching the
+ configuration directories for any other matching file.</para>
</refsect1>
<refsect1>