tmpfiles: log at info level when some allowed failures occur
authorLuca Boccassi <bluca@debian.org>
Thu, 10 Nov 2022 15:47:19 +0000 (15:47 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Nov 2022 07:53:07 +0000 (08:53 +0100)
commit244c2a8344c01e94cd9bdf835de998b89bc53179
tree47a9b91e12f623401cd66f887de2daa7937cba0d
parentdab0156f03a81c9b09a2f17b36f07f27475b7bce
tmpfiles: log at info level when some allowed failures occur

In provision.conf we ship:

d- /root :0700 root :root -
d- /root/.ssh :0700 root :root -

These are allowed to fail, for example on a read-only filesystem. But they still
log at error level, which is annoying and gets flagged. Tune those specific errors
down to info.

There are likely more that could be tuned down, but the important thing is to cover
the tmpfiles.d that we ship right now.

Before:

$ echo -e "d- /root :0700 root :root - \nd- /root/.ssh :0700 root :root -" | SYSTEMD_LOG_LEVEL=err build/systemd-tmpfiles --root=/tmp/img --create -
Failed to create directory or subvolume "/tmp/img/root": Read-only file system
Failed to open path '/tmp/img/root': No such file or directory
$

After:

$ echo -e "d- /root :0700 root :root - \nd- /root/.ssh :0700 root :root -" | SYSTEMD_LOG_LEVEL=err build/systemd-tmpfiles --root=/tmp/img --create -
$
src/tmpfiles/tmpfiles.c