tmpfiles: in C lines, make missing source graceful error
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2022 15:16:02 +0000 (17:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 26 Aug 2022 09:11:48 +0000 (11:11 +0200)
commitce610af143b2a11011f00c65ea96f7a88453373b
tree22d6f6ba415c446bd7fe21702d99aad3c3e52857
parent1a0e065e9f154f46fd68cd45f46310bc7df7a51c
tmpfiles: in C lines, make missing source graceful error

I don't see where it would ever be a good thing that file copies done
via tmpfiles.d/ C lines cause the tmpfiles operation to fail if their
source happens to be missing. It's a problem if we can't set up the
destination properly (which is the job of systemd-tmpfiles after all),
but if the source is simply missing (NB: setting up the source is the job of
of the rules writer) this shouldn't be a problem.

This is useful for copying stuff into place if it happens to exist. For
example, if systemd-stub passes additional data into the initrd's
/.extra/ directory, we can copy it into a better place (e.g. /run/) with
this, where it will survive the initrd→host transition.

This mirrors behaviour of the recently added "^" line modifier which may
be used source "w" lines from credentials â€“ there two the behaviour is
to simply skip the line if the source is missing.
src/tmpfiles/tmpfiles.c
test/units/testsuite-22.02.sh