diff mbox series

[V2] systemd: fix a dead link under /var/log

Message ID 20240204080105.3614423-1-changqing.li@windriver.com
State New
Headers show
Series [V2] systemd: fix a dead link under /var/log | expand

Commit Message

Changqing Li Feb. 4, 2024, 8:01 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

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

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Kjellerstedt Feb. 4, 2024, 4:57 p.m. UTC | #1
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Changqing Li
> Sent: den 4 februari 2024 09:01
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH V2] systemd: fix a dead link under /var/log
> 
> From: Changqing Li <changqing.li@windriver.com>
> 
> 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

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

> 
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>  meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meta/recipes-core/systemd/systemd_255.1.bb b/meta/recipes-core/systemd/systemd_255.1.bb
> index 9e09c89355..3669d3cdc8 100644
> --- a/meta/recipes-core/systemd/systemd_255.1.bb
> +++ b/meta/recipes-core/systemd/systemd_255.1.bb
> @@ -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 (){
> --
> 2.25.1

//Peter
Changqing Li Feb. 7, 2024, 8:35 a.m. UTC | #2
On 2/5/24 00:57, Peter Kjellerstedt wrote:
> 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.
>
>> -----Original Message-----
>> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Changqing Li
>> Sent: den 4 februari 2024 09:01
>> To: openembedded-core@lists.openembedded.org
>> Subject: [OE-core] [PATCH V2] systemd: fix a dead link under /var/log
>>
>> From: Changqing Li <changqing.li@windriver.com>
>>
>> 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
> 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

>
>> Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> ---
>>   meta/recipes-core/systemd/systemd_255.1.bb | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_255.1.bb b/meta/recipes-core/systemd/systemd_255.1.bb
>> index 9e09c89355..3669d3cdc8 100644
>> --- a/meta/recipes-core/systemd/systemd_255.1.bb
>> +++ b/meta/recipes-core/systemd/systemd_255.1.bb
>> @@ -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 (){
>> --
>> 2.25.1
> //Peter
>
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_255.1.bb b/meta/recipes-core/systemd/systemd_255.1.bb
index 9e09c89355..3669d3cdc8 100644
--- a/meta/recipes-core/systemd/systemd_255.1.bb
+++ b/meta/recipes-core/systemd/systemd_255.1.bb
@@ -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 (){