Skip to contentSkip to conversation

systemd: fix a dead link under /var/log

PATCH Superseded [email protected] 2 participants 3 messages Feb 4, 2024 – Feb 7, 2024

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 systemd: fix a dead link under /var/log

From: Changqing Li <[email protected]>

Commit 6fe23ff31c0 changed README to a symlink to README.logs, and install README.logs under systemd doc dir.

But for OE, systemd doc dir is splited into package systemd-doc, when it is not installed on the target, there will be an dead link:
Eg:

root@intel-x86-64:/var/log# ls -l README
lrwxrwxrwx 1 root root 39 Jun 20 08:57 README -> ../../usr/share/doc/systemd/README.logs
root@intel-x86-64:/var/log# ls -l ../../usr/share/doc/systemd/README.logs
ls: cannot access '../../usr/share/doc/systemd/README.logs': No such file or directory

Meantime, relative path for a symlink also will meet issue like "No such file or directory"

Since OE have set ForwardToSyslog=yes, this README is not needed. So remove this symlink from package systemd

---
 meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/systemd/systemd_255.1.bb +4 -0
index 9e09c89355..3669d3cdc8 100644
@@ -386,6 +386,10 @@ do_install() {
         sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
             ${D}/${sysconfdir}/systemd/system.conf
     fi
+
+    if [ -f "${D}${prefix}/lib/tmpfiles.d/legacy.conf" ]; then
+        sed -i -e '/^L \/var\/log\/README/d' ${D}${prefix}/lib/tmpfiles.d/legacy.conf
+    fi
 }
 
 python populate_packages:prepend (){
Signature · 1 line
2.25.1
#1 lore raw
Quoted 19 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Changqing Li
Sent: den 4 februari 2024 09:01
To: [email protected]
Subject: [OE-core] [PATCH V2] systemd: fix a dead link under /var/log

From: Changqing Li <[email protected]>

Commit 6fe23ff31c0 changed README to a symlink to README.logs, and install README.logs under systemd doc dir.

But for OE, systemd doc dir is splited into package systemd-doc, when it is not installed on the target, there will be an dead link:
Eg:

root@intel-x86-64:/var/log# ls -l README
lrwxrwxrwx 1 root root 39 Jun 20 08:57 README -> ../../usr/share/doc/systemd/README.logs
root@intel-x86-64:/var/log# ls -l ../../usr/share/doc/systemd/README.logs
ls: cannot access '../../usr/share/doc/systemd/README.logs': No such file or directory
Quoted 5 lines

Meantime, relative path for a symlink also will meet issue like "No such file or directory"

Since OE have set ForwardToSyslog=yes, this README is not needed. So remove this symlink from package systemd

Wouldn't it make more sense to package the link in the systemd-doc package, along with the rest of the documentation?

Quoted 22 lines
---
 meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/systemd/systemd_255.1.bb +4 -1
index 9e09c89355..3669d3cdc8 100644
@@ -386,6 +386,10 @@ do_install() {
         sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
             ${D}/${sysconfdir}/systemd/system.conf
     fi
+
+    if [ -f "${D}${prefix}/lib/tmpfiles.d/legacy.conf" ]; then
+        sed -i -e '/^L \/var\/log\/README/d' ${D}${prefix}/lib/tmpfiles.d/legacy.conf
+    fi
 }
 
 python populate_packages:prepend (){
--
Quoted 1 line

2.25.1

//Peter

#2 lore raw
Quoted 22 lines · Peter Kjellerstedt

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 19 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Changqing Li
Sent: den 4 februari 2024 09:01
To: [email protected]
Subject: [OE-core] [PATCH V2] systemd: fix a dead link under /var/log

From: Changqing Li <[email protected]>

Commit 6fe23ff31c0 changed README to a symlink to README.logs, and install README.logs under systemd doc dir.

But for OE, systemd doc dir is splited into package systemd-doc, when it is not installed on the target, there will be an dead link:
Eg:

root@intel-x86-64:/var/log# ls -l README
lrwxrwxrwx 1 root root 39 Jun 20 08:57 README -> ../../usr/share/doc/systemd/README.logs
root@intel-x86-64:/var/log# ls -l ../../usr/share/doc/systemd/README.logs
ls: cannot access '../../usr/share/doc/systemd/README.logs': No such file or directory
Quoted 7 lines
Quoted 5 lines

Meantime, relative path for a symlink also will meet issue like "No such file or directory"

Since OE have set ForwardToSyslog=yes, this README is not needed. So remove this symlink from package systemd

Wouldn't it make more sense to package the link in the systemd-doc package, along with the rest of the documentation?

Thanks, V3 is sent.

Regards

Changqing

Quoted 25 lines
Quoted 22 lines
---
  meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-core/systemd/systemd_255.1.bb +4 -1
index 9e09c89355..3669d3cdc8 100644
@@ -386,6 +386,10 @@ do_install() {
          sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
              ${D}/${sysconfdir}/systemd/system.conf
      fi
+
+    if [ -f "${D}${prefix}/lib/tmpfiles.d/legacy.conf" ]; then
+        sed -i -e '/^L \/var\/log\/README/d' ${D}${prefix}/lib/tmpfiles.d/legacy.conf
+    fi
  }
 
  python populate_packages:prepend (){
--
Quoted 1 line

2.25.1

//Peter