diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-08 00:48:35 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-08 20:16:37 +0200 |
commit | b88ba6c76116b6e03e202b1bdffd37933f748f03 (patch) | |
tree | 28b28517f14008f3e8303a7c8da181d0d1e876a5 /man/systemd-tmpfiles.xml | |
parent | TEST-33-CLEAN-UNIT: fix broken test exposed by condition check fix (diff) | |
download | systemd-b88ba6c76116b6e03e202b1bdffd37933f748f03.tar.xz systemd-b88ba6c76116b6e03e202b1bdffd37933f748f03.zip |
tmpfiles: make handling of existing-but-different targets more consistent
create_fifo() was added in a2fc2f8dd30c17ad1e23a31fc6ff2aeba4c6fa27, and
would always ignore failure. The test was trying to fail in this case, but
we actually don't fail, which seems to be correct. We didn't notice before
because the test was ineffective.
To make things consistent, generally log at warning level, but don't propagate
the error. For symlinks, log at debug level, as before.
For 'e', failure is not propagated now. The test is adjusted to match.
I think warning is appropriate in most cases: we do not expect a device node to
be replaced by a different device node or even a non-device file. This would
most likely be an error somewhere. An exception is made for symlinks, which are
mismatched on purpose, for example /etc/resolv.conf. With this patch, we don't
get any warnings with the any of the 74 tmpfiles.d files, which suggests that
increasing the warning levels will not cause too many unexpected warnings. If
it turns out that there are valid cases where people have expected mismatches
for non-symlink types, we can always decrease the log levels again.
Diffstat (limited to 'man/systemd-tmpfiles.xml')
-rw-r--r-- | man/systemd-tmpfiles.xml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml index 5f97e37025..15bc1ea889 100644 --- a/man/systemd-tmpfiles.xml +++ b/man/systemd-tmpfiles.xml @@ -263,16 +263,18 @@ <refsect1> <title>Exit status</title> - <para>On success, 0 is returned. If the configuration was syntactically invalid (syntax errors, - missing arguments, …), so some lines had to be ignored, but no other errors occurred, - <constant>65</constant> is returned (<constant>EX_DATAERR</constant> from - <filename>/usr/include/sysexits.h</filename>). If the configuration was syntactically valid, but - could not be executed (lack of permissions, creation of files in missing directories, invalid - contents when writing to <filename>/sys/</filename> values, …), <constant>73</constant> is - returned (<constant>EX_CANTCREAT</constant> from <filename>/usr/include/sysexits.h</filename>). - Otherwise, <constant>1</constant> is returned (<constant>EXIT_FAILURE</constant> from - <filename>/usr/include/stdlib.h</filename>). - </para> + <para>On success, 0 is returned. If the configuration was syntactically invalid (syntax errors, missing + arguments, …), so some lines had to be ignored, but no other errors occurred, <constant>65</constant> is + returned (<constant>EX_DATAERR</constant> from <filename>/usr/include/sysexits.h</filename>). If the + configuration was syntactically valid, but could not be executed (lack of permissions, creation of files + in missing directories, invalid contents when writing to <filename>/sys/</filename> values, …), + <constant>73</constant> is returned (<constant>EX_CANTCREAT</constant> from + <filename>/usr/include/sysexits.h</filename>). Otherwise, <constant>1</constant> is returned + (<constant>EXIT_FAILURE</constant> from <filename>/usr/include/stdlib.h</filename>).</para> + + <para>Note: when creating items, if the target already exists, but is of the wrong type or otherwise does + not match the requested state, and forced operation has not been requested with <literal>+</literal>, + a message is emitted, but the failure is otherwise ignored.</para> </refsect1> <refsect1> |