diff options
author | Niko Mauno <niko.mauno@vaisala.com> | 2024-07-09 12:22:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-16 11:56:53 +0100 |
commit | 504cc9860e41887f73830e74372d03869e4cb970 (patch) | |
tree | 9e44a186b09255528da36fa5036a93dac9be209f | |
parent | 16aaff7a356215cf88bc3658ed48fb04394d9a4b (diff) | |
download | poky-504cc9860e41887f73830e74372d03869e4cb970.tar.gz |
systemd: Mitigate /var/log type mismatch issue
When VOLATILE_LOG_DIR evaluates as True, the base-files recipe provides
/var/log -> /var/volatile/log symlink which is in conflict with systemd
upstream tmpfiles.d/var.conf.in which defines it as a directory.
This generates following error in journal:
Jul 03 14:28:00 qemux86-64 systemd-tmpfiles[165]: "/var/log" already exists and is not a directory.
Mitigate the issue by defining /var/log as symlink corresponding to
the one created by base-files, when appropriate.
(From OE-Core rev: 711ee36e88c8968e3c45ea787b3adcf64352adf9)
Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/systemd/systemd_256.bb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/recipes-core/systemd/systemd_256.bb b/meta/recipes-core/systemd/systemd_256.bb index 9bd59ef39f..3579c71891 100644 --- a/meta/recipes-core/systemd/systemd_256.bb +++ b/meta/recipes-core/systemd/systemd_256.bb | |||
@@ -314,9 +314,10 @@ do_install() { | |||
314 | fi | 314 | fi |
315 | 315 | ||
316 | if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then | 316 | if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then |
317 | # /var/log is typically a symbolic link to inside /var/volatile, | 317 | # base-files recipe provides /var/log which is a symlink to /var/volatile/log |
318 | # which is expected to be empty. | ||
319 | rm -rf ${D}${localstatedir}/log | 318 | rm -rf ${D}${localstatedir}/log |
319 | printf 'L\t\t%s/log\t\t-\t-\t-\t-\t%s/volatile/log\n' "${localstatedir}" \ | ||
320 | "${localstatedir}" >>${D}${nonarch_libdir}/tmpfiles.d/00-create-volatile.conf | ||
320 | elif [ -e ${D}${localstatedir}/log/journal ]; then | 321 | elif [ -e ${D}${localstatedir}/log/journal ]; then |
321 | chown root:systemd-journal ${D}${localstatedir}/log/journal | 322 | chown root:systemd-journal ${D}${localstatedir}/log/journal |
322 | 323 | ||