From f742f9d317698c81ec58828814081d8d8a013762 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 10 May 2020 11:44:53 +0200 Subject: [PATCH 1/2] man: mention the exclamation mark and minus sign literally, to make things searchable I was looking for the explanation for the exclamation mark in the text, and couldn't find it, searching for "!". Let's make this easier, and indicate the character meant. --- man/tmpfiles.d.xml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 90234c3d43..1e761e9b05 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -154,8 +154,8 @@ L /tmp/foobar - - - - /dev/null Type - The type consists of a single letter and optionally an - exclamation mark and/or minus sign. + The type consists of a single letter and optionally an exclamation mark (!) + and/or minus sign (-). The following line types are understood: @@ -453,13 +453,10 @@ L /tmp/foobar - - - - /dev/null - If the exclamation mark is used, this line is only safe to - execute during boot, and can break a running system. Lines - without the exclamation mark are presumed to be safe to execute - at any time, e.g. on package upgrades. - systemd-tmpfiles will execute line with an - exclamation mark only if option is - given. + If the exclamation mark (!) is used, this line is only safe to execute during + boot, and can break a running system. Lines without the exclamation mark are presumed to be safe to + execute at any time, e.g. on package upgrades. systemd-tmpfiles will take lines with + an exclamation mark only into consideration, if the option is given. For example: # Make sure these are created by default so that nobody else can @@ -471,9 +468,8 @@ r! /tmp/.X[0-9]*-lock running system, and will only be executed with . - If the minus sign is used, this line failing to run - successfully during create (and only create) will not cause - the execution of systemd-tmpfiles to return + If the minus sign (-) is used, this line failing to run successfully during + create (and only create) will not cause the execution of systemd-tmpfiles to return an error. For example: From ead2a4a2310789a18615987ed293d8bb8a246a88 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 10 May 2020 11:45:52 +0200 Subject: [PATCH 2/2] tmpfiles: clarify that "!" lines are filtered before collisions are checked Fixes: #15675 --- man/tmpfiles.d.xml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 1e761e9b05..b9e9eee96c 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -121,16 +121,19 @@ A+ /path-or-glob/to/append/acls/recursively - - - - POSIX /usr/lib/tmpfiles.d and /run/tmpfiles.d. Files in /run/tmpfiles.d override files with the same name in /usr/lib/tmpfiles.d. Packages should install their configuration files in - /usr/lib/tmpfiles.d. Files in /etc/tmpfiles.d are reserved for the local - administrator, who may use this logic to override the configuration files installed by vendor packages. All - configuration files are sorted by their filename in lexicographic order, regardless of which of the directories - they reside in. If multiple files specify the same path, the entry in the file with the lexicographically earliest - name will be applied. All other conflicting entries will be logged as errors. When two lines are prefix path and - suffix path of each other, then the prefix line is always created first, the suffix later (and if removal applies - to the line, the order is reversed: the suffix is removed first, the prefix later). Lines that take globs are - applied after those accepting no globs. If multiple operations shall be applied on the same file (such as ACL, - xattr, file attribute adjustments), these are always done in the same fixed order. Except for those cases, the - files/directories are processed in the order they are listed. + /usr/lib/tmpfiles.d. Files in /etc/tmpfiles.d are reserved for + the local administrator, who may use this logic to override the configuration files installed by vendor + packages. All configuration files are sorted by their filename in lexicographic order, regardless of + which of the directories they reside in. If multiple files specify the same path, the entry in the file + with the lexicographically earliest name will be applied (note that lines suppressed due to the + ! are filtered before application, meaning that if an early line carries the + exclamation mark and is suppressed because of that, a later line matching in path will be applied). All + other conflicting entries will be logged as errors. When two lines are prefix path and suffix path of + each other, then the prefix line is always created first, the suffix later (and if removal applies to the + line, the order is reversed: the suffix is removed first, the prefix later). Lines that take globs are + applied after those accepting no globs. If multiple operations shall be applied on the same file (such as + ACL, xattr, file attribute adjustments), these are always done in the same fixed order. Except for those + cases, the files/directories are processed in the order they are listed. If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink