diff mbox series

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

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

Commit Message

Changqing Li June 29, 2023, 10:10 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>
---
 ...on-t-create-symlink-README-in-this-f.patch | 42 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_253.3.bb    |  2 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch

Comments

Richard Purdie June 29, 2023, 11:44 a.m. UTC | #1
On Thu, 2023-06-29 at 18:10 +0800, Changqing Li wrote:
> 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>
> ---
>  ...on-t-create-symlink-README-in-this-f.patch | 42 +++++++++++++++++++
>  meta/recipes-core/systemd/systemd_253.3.bb    |  2 +-
>  2 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
> 
> diff --git a/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
> new file mode 100644
> index 0000000000..a2644bba8e
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
> @@ -0,0 +1,42 @@
> +From b17826490c1db2051dda23550ebdcd7f10e23479 Mon Sep 17 00:00:00 2001
> +From: Changqing Li <changqing.li@windriver.com>
> +Date: Wed, 28 Jun 2023 13:49:41 +0800
> +Subject: [PATCH 1/2] legacy.conf.in: Don't create symlink README in this file
> +
> +Commit 6fe23ff31c0 changed README to an 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
> +
> +So remove this symlink from package systemd
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
> +---
> + tmpfiles.d/legacy.conf.in | 3 ---
> + 1 file changed, 3 deletions(-)
> +
> +diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in
> +index 4f2c0d7c43..62e2ae0986 100644
> +--- a/tmpfiles.d/legacy.conf.in
> ++++ b/tmpfiles.d/legacy.conf.in
> +@@ -12,9 +12,6 @@
> + 
> + d /run/lock 0755 root root -
> + L /var/lock - - - - ../run/lock
> +-{% if CREATE_LOG_DIRS %}
> +-L /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
> +-{% endif %}
> + 
> + # /run/lock/subsys is used for serializing SysV service execution, and
> + # hence without use on SysV-less systems.
> +-- 
> +2.25.1
> +
> diff --git a/meta/recipes-core/systemd/systemd_253.3.bb b/meta/recipes-core/systemd/systemd_253.3.bb
> index 87fbf6f785..d8b94e370c 100644
> --- a/meta/recipes-core/systemd/systemd_253.3.bb
> +++ b/meta/recipes-core/systemd/systemd_253.3.bb
> @@ -28,6 +28,7 @@ SRC_URI += " \
>             file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
>             file://27254.patch \
>             file://27253.patch \
> +           file://0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch \
>             "
>  
>  # patches needed by musl
> @@ -760,7 +761,6 @@ FILES:udev += "${base_sbindir}/udevd \
>  
>  FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
>                     "
> -
>  RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
>  
>  INITSCRIPT_PACKAGES = "udev"

The whitespace change in this patch shouldn't be there.

I'm not sure we really want to carry a patch doing this "forever". 

Could we turn off CREATE_LOG_DIR or would that break something else?

Cheers,

Richard
Changqing Li July 11, 2023, 3:32 a.m. UTC | #2
On 6/29/23 19:44, Richard Purdie 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.
>
> On Thu, 2023-06-29 at 18:10 +0800, Changqing Li wrote:
>> 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>
>> ---
>>   ...on-t-create-symlink-README-in-this-f.patch | 42 +++++++++++++++++++
>>   meta/recipes-core/systemd/systemd_253.3.bb    |  2 +-
>>   2 files changed, 43 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
>>
>> diff --git a/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
>> new file mode 100644
>> index 0000000000..a2644bba8e
>> --- /dev/null
>> +++ b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
>> @@ -0,0 +1,42 @@
>> +From b17826490c1db2051dda23550ebdcd7f10e23479 Mon Sep 17 00:00:00 2001
>> +From: Changqing Li <changqing.li@windriver.com>
>> +Date: Wed, 28 Jun 2023 13:49:41 +0800
>> +Subject: [PATCH 1/2] legacy.conf.in: Don't create symlink README in this file
>> +
>> +Commit 6fe23ff31c0 changed README to an 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
>> +
>> +So remove this symlink from package systemd
>> +
>> +Upstream-Status: Inappropriate [oe specific]
>> +
>> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> +---
>> + tmpfiles.d/legacy.conf.in | 3 ---
>> + 1 file changed, 3 deletions(-)
>> +
>> +diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in
>> +index 4f2c0d7c43..62e2ae0986 100644
>> +--- a/tmpfiles.d/legacy.conf.in
>> ++++ b/tmpfiles.d/legacy.conf.in
>> +@@ -12,9 +12,6 @@
>> +
>> + d /run/lock 0755 root root -
>> + L /var/lock - - - - ../run/lock
>> +-{% if CREATE_LOG_DIRS %}
>> +-L /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
>> +-{% endif %}
>> +
>> + # /run/lock/subsys is used for serializing SysV service execution, and
>> + # hence without use on SysV-less systems.
>> +--
>> +2.25.1
>> +
>> diff --git a/meta/recipes-core/systemd/systemd_253.3.bb b/meta/recipes-core/systemd/systemd_253.3.bb
>> index 87fbf6f785..d8b94e370c 100644
>> --- a/meta/recipes-core/systemd/systemd_253.3.bb
>> +++ b/meta/recipes-core/systemd/systemd_253.3.bb
>> @@ -28,6 +28,7 @@ SRC_URI += " \
>>              file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
>>              file://27254.patch \
>>              file://27253.patch \
>> +           file://0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch \
>>              "
>>
>>   # patches needed by musl
>> @@ -760,7 +761,6 @@ FILES:udev += "${base_sbindir}/udevd \
>>
>>   FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
>>                      "
>> -
>>   RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
>>
>>   INITSCRIPT_PACKAGES = "udev"
> The whitespace change in this patch shouldn't be there.
>
> I'm not sure we really want to carry a patch doing this "forever".
>
> Could we turn off CREATE_LOG_DIR or would that break something else?

if turn off CREATE_LOG_DIR, " /var/log/journal/" will not be created.  
By default,  VOLATILE_DIR = "yes",  this change will have no influence, 
since we will remove content under /var/log.

if VOLATILE_DIR set to "no", the current default behavior will be 
changed,  log will saved from  persistent  to memory.   our default 
Storage set to auto,  if " /var/log/journal/" not exist, the log will  
save  in memory /run/log/journal.

@Richard,  do you think this change of current bebavior  is accepted?  
if yes, I can send an V2 to turn of the CREATE_LOG_DIR.  Thanks


Refer:

[1] https://www.freedesktop.org/software/systemd/man/journald.conf.html

//Changqing


>
> Cheers,
>
> Richard
>
>
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
new file mode 100644
index 0000000000..a2644bba8e
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch
@@ -0,0 +1,42 @@ 
+From b17826490c1db2051dda23550ebdcd7f10e23479 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Wed, 28 Jun 2023 13:49:41 +0800
+Subject: [PATCH 1/2] legacy.conf.in: Don't create symlink README in this file
+
+Commit 6fe23ff31c0 changed README to an 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
+
+So remove this symlink from package systemd
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ tmpfiles.d/legacy.conf.in | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in
+index 4f2c0d7c43..62e2ae0986 100644
+--- a/tmpfiles.d/legacy.conf.in
++++ b/tmpfiles.d/legacy.conf.in
+@@ -12,9 +12,6 @@
+ 
+ d /run/lock 0755 root root -
+ L /var/lock - - - - ../run/lock
+-{% if CREATE_LOG_DIRS %}
+-L /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
+-{% endif %}
+ 
+ # /run/lock/subsys is used for serializing SysV service execution, and
+ # hence without use on SysV-less systems.
+-- 
+2.25.1
+
diff --git a/meta/recipes-core/systemd/systemd_253.3.bb b/meta/recipes-core/systemd/systemd_253.3.bb
index 87fbf6f785..d8b94e370c 100644
--- a/meta/recipes-core/systemd/systemd_253.3.bb
+++ b/meta/recipes-core/systemd/systemd_253.3.bb
@@ -28,6 +28,7 @@  SRC_URI += " \
            file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
            file://27254.patch \
            file://27253.patch \
+           file://0001-legacy.conf.in-Don-t-create-symlink-README-in-this-f.patch \
            "
 
 # patches needed by musl
@@ -760,7 +761,6 @@  FILES:udev += "${base_sbindir}/udevd \
 
 FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
                    "
-
 RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
 
 INITSCRIPT_PACKAGES = "udev"