Skip to contentSkip to conversation

systemd: fix dead link /var/log/README

PATCH In review [email protected] 2 participants 2 messages Mar 7, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 systemd: fix dead link /var/log/README

From: Changqing Li <[email protected]>

There are 2 issues here:
First, in package systemd, there is a file /usr/lib/tmpfile.d/legacy.conf, which will create a symlink to /usr/share/doc/systemd/README.logs during boot time. But for oe, /usr/share/doc/systemd/README.logs is packaged in systemd-doc, which will make /var/log/README is dead link.

Second, the symlink /var/log/README in legacy.conf use relative path:
"L /var/log/README - - - - ../../usr/share/doc/systemd/README.logs" But for oe, when VOLATILE_LOG_DIR is true, /var/log is a link to /var/volatile/log, so /var/log/README need link to ../../../usr/share/doc/systemd/README.logs, while VOLATILE_LOG_DIR is false, /var/log is a dir, so /var/log/README need link to ../../usr/share/doc/systemd/README.logs. So current symlink in legacy.conf will also make it a dead link when VOLATILE_LOG_DIR is true.

Turn off CREATE_LOG_DIRS to avoid these issues.

---
 meta/recipes-core/systemd/systemd_255.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_255.1.bb +1 -0
index a907d60e84..9fd7eccb38 100644
@@ -247,6 +247,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dsystem-uid-max=999 \
                   -Dsystem-alloc-gid-min=101 \
                   -Dsystem-gid-max=999 \
+                  -Dcreate-log-dirs=false \
                   "
 
 # Hardcode target binary paths to avoid using paths from sysroot or worse
Signature · 1 line
2.25.1
#1 lore raw

This is causing errors in do_install

| chown: cannot access '/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/systemd/255.4/image/var/log/journal':
No such file or directory

Quoted 49 lines · Changqing Li

From: Changqing Li <[email protected]>

There are 2 issues here:
First, in package systemd, there is a file /usr/lib/tmpfile.d/legacy.conf, which will create a symlink to /usr/share/doc/systemd/README.logs during boot time. But for oe, /usr/share/doc/systemd/README.logs is packaged in systemd-doc, which will make /var/log/README is dead link.

Second, the symlink /var/log/README in legacy.conf use relative path:
"L /var/log/README - - - - ../../usr/share/doc/systemd/README.logs" But for oe, when VOLATILE_LOG_DIR is true, /var/log is a link to /var/volatile/log, so /var/log/README need link to ../../../usr/share/doc/systemd/README.logs, while VOLATILE_LOG_DIR is false, /var/log is a dir, so /var/log/README need link to ../../usr/share/doc/systemd/README.logs. So current symlink in legacy.conf will also make it a dead link when VOLATILE_LOG_DIR is true.

Turn off CREATE_LOG_DIRS to avoid these issues.

---
 meta/recipes-core/systemd/systemd_255.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_255.1.bb +1 -1
index a907d60e84..9fd7eccb38 100644
@@ -247,6 +247,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dsystem-uid-max=999 \
                   -Dsystem-alloc-gid-min=101 \
                   -Dsystem-gid-max=999 \
+                  -Dcreate-log-dirs=false \
                   "
 
 # Hardcode target binary paths to avoid using paths from sysroot or worse
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196773): https://lists.openembedded.org/g/openembedded-core/message/196773
Mute This Topic: https://lists.openembedded.org/mt/104782978/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-