<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15678</bug_id>
          
          <creation_ts>2024-12-03 16:52:54 +0000</creation_ts>
          <short_desc>Systemd disables creation of /var/log/journal and related directories</short_desc>
          <delta_ts>2025-02-06 01:22:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>5.0.5</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>5.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Steffen Kothe">Steffen.Kothe</reporter>
          <assigned_to name="Changqing Li">changqing.li</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>niko.mauno</cc>
    
    <cc>raj.khem</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>100340</commentid>
    <comment_count>0</comment_count>
      <attachid>5086</attachid>
    <who name="Steffen Kothe">Steffen.Kothe</who>
    <bug_when>2024-12-03 16:52:54 +0000</bug_when>
    <thetext>Created attachment 5086
Suggestion for systemd upstream fix when bug is confirmed in Yocto

18d46e11d85d (&quot;systemd: fix dead link /var/log/README&quot;)

Disabled the build time creation of the /var/log/journal directories in favor of keeping a README which is mostly irrelevant for most embedded Linux systems, usually not shipping documentation. 

Additionally does this &quot;fix&quot; change the behavior of VOLATILE_LOG_DIR, since logs are not persistently stored anymore, because systemd does not recreate the directory structure during boot via systemd-tmpfiles.d.

While non-persistent logs are not getting affected by this change does it affect the persistent storing of logs. They are lost, so it can be assumed that the mentioned fixed introduced a bug when VOLATILE_LOG_DIR = &quot;1&quot; is set.

Recommendation/counter measure:

Revert this commit and drop the suspicious README link from the legacy configuration file via sed script or patch.

A patch is attached, which was not sent upstream yet to re-enable.

A contribution with a fix is intended to be sent when the bug is confirmed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100352</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-12-05 15:37:28 +0000</bug_when>
    <thetext>Sandy/Changqing, Did you or someone else in the WR team change this?
Can someone take a look, please. 
Nico may be involved, I don&apos;t have time to check right now, sorry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100368</commentid>
    <comment_count>2</comment_count>
    <who name="Changqing Li">changqing.li</who>
    <bug_when>2024-12-06 04:38:38 +0000</bug_when>
    <thetext>@steffen, @Randy

Please refer this V1 patch comments and V5 patch comments:
https://patchwork.yoctoproject.org/project/oe-core/patch/20230629101038.3772750-1-changqing.li@windriver.com/
https://patchwork.yoctoproject.org/project/oe-core/patch/20240227051155.2166683-1-changqing.li@windriver.com/

And then finally we have this commit:
18d46e11d85d (&quot;systemd: fix dead link /var/log/README&quot;)


The attached patch is the same as the V1 patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100391</commentid>
    <comment_count>3</comment_count>
    <who name="Steffen Kothe">Steffen.Kothe</who>
    <bug_when>2024-12-09 17:49:37 +0000</bug_when>
    <thetext>Circumventing this issue for creating the /var/log/journal can be done by configuring journald.conf to make the storage persistent.

See Options, &quot;Storage&quot; in https://man7.org/linux/man-pages/man5/journald.conf.5.html

Wouldn&apos;t it be an idea then to couple VOLATILE_LOG_DIR to this configuration additionally to the V5 patch posted.

This is exactly what breaks here due to a README which seems to be part of the doc package anyway or am I wrong?

Happy to contribute here.


Meanwhile - create-log-dirs also affects the journald companions systemd-journal-remote and gatewayd.

This directory is also created by this flag during built time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100416</commentid>
    <comment_count>4</comment_count>
    <who name="Changqing Li">changqing.li</who>
    <bug_when>2024-12-12 10:23:04 +0000</bug_when>
    <thetext>There is behavior change after disabling create-log-dirs:

when create-log-dirs is enabled,  /var/log/journal will be created, and since &quot;Storage&quot; in journald.conf is default &quot;Auto&quot;, when it defects exist of &quot;/var/log/journal&quot;, then log will be storge under /var/log/journal.  And this is recipe level.  And if /var/log/journal is really persistent,  it is decided by the distro level config, now it is named as &quot;FILESYSTEM_PERMS_TABLES&quot; now. user only need to change FILESYSTEM_PERMS_TABLES to make systemd log persistent


after create-log-dirs is disabled,  /var/log/journal is not created,  and since &quot;Storage&quot; in journald.conf is default &quot;Auto&quot;,  since /var/log/journal not exist,
/run/log/journal will be used to store log. which is not persistent. if user want persistent log,  they need to change &quot;Storage&quot; to &quot;persistent&quot; in journald.conf, then /var/log/journal will be created to store log. Then distro level config &quot;FILESYSTEM_PERMS_TABLES&quot; will decide if it is a really persistent. 



This cause user have to do extra change of journald.conf to make log persistent.
and maybe we should make the behavior back? For the README issue, since this README is not very useful, maybe we can just don&apos;t create it, Attached the RFC patch.


@Richard, @Khem,  what&apos;s your opinion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100417</commentid>
    <comment_count>5</comment_count>
      <attachid>5087</attachid>
    <who name="Changqing Li">changqing.li</who>
    <bug_when>2024-12-12 10:24:05 +0000</bug_when>
    <thetext>Created attachment 5087
enable create-log-dirs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100419</commentid>
    <comment_count>6</comment_count>
    <who name="Steffen Kothe">Steffen.Kothe</who>
    <bug_when>2024-12-12 12:00:08 +0000</bug_when>
    <thetext>There was a discussion about the systemd-doc packages which suggested to keep the README there.

Having a link for no reason makes no sense, so dropping it seems to be okay.

This restores the creation of the directories anyway and even leaves, if required, the generation of journald associated packages and its users intact.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100849</commentid>
    <comment_count>7</comment_count>
    <who name="Changqing Li">changqing.li</who>
    <bug_when>2025-02-06 01:17:44 +0000</bug_when>
    <thetext>enable create-log-dirs in this commit:
https://git.openembedded.org/openembedded-core/commit/?id=f82d9c997ba8cc23b472d44a43489c597bf452af</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100850</commentid>
    <comment_count>8</comment_count>
    <who name="Changqing Li">changqing.li</who>
    <bug_when>2025-02-06 01:22:54 +0000</bug_when>
    <thetext>enable create-log-dirs in this commit:
https://git.openembedded.org/openembedded-core/commit/?id=f82d9c997ba8cc23b472d44a43489c597bf452af</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5086</attachid>
            <date>2024-12-03 16:52:54 +0000</date>
            <delta_ts>2024-12-03 16:52:54 +0000</delta_ts>
            <desc>Suggestion for systemd upstream fix when bug is confirmed in Yocto</desc>
            <filename>0001-tmpfiles.d-Drop-README-link-from-legacy.conf.patch</filename>
            <type>text/plain</type>
            <size>1625</size>
            <attacher name="Steffen Kothe">Steffen.Kothe</attacher>
            
              <data encoding="base64">RnJvbSAxN2RlOWU5ZDZjYWU4YTUxYmJkMjg2NGQ5NWJiYzQ0NzQ4YzE1ZjY5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmZmVuIEtvdGhlIDxzdGVmZmVuLmtvdGhlQGR1YWdvbi5j
b20+CkRhdGU6IEZyaSwgMjkgTm92IDIwMjQgMTk6NDQ6MjQgKzAxMDAKU3ViamVjdDogW1BBVENI
IDEvMV0gdG1wZmlsZXMuZDogRHJvcCBSRUFETUUgbGlu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2F0ZWQgaW4gZG9jX2Rpci4KClVwc3RyZWFtLVN0YXR1czogUGVuZGluZwoKU2ln
bmVkLW9mZi1ieTogU3RlZmZlbiBLb3RoZSA8c3RlZmZlbi5rb3RoZUBkdWFnb24uY29tPgotLS0K
IHRtcGZpbGVzLmQvbGVnYWN5LmNvbmYuaW4gfCAzIC0tLQogMSBmaWxlIGNoYW5nZWQsIDMgZGVs
ZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvdG1wZmlsZXMuZC9sZWdhY3kuY29uZi5pbiBiL3RtcGZp
bGVzLmQvbGVnYWN5LmNvbmYuaW4KaW5kZXggNGYyYzBkN2M0My4uNjJlMmFlMDk4NiAxMDA2NDQK
LS0tIGEvdG1wZmlsZXMuZC9sZWdhY3kuY29uZi5pbgorKysgYi90bXBmaWxlcy5kL2xlZ2FjeS5j
b25mLmluCkBAIC0xMiw5ICsxMiw2IEBACiAKIGQgL3J1bi9sb2NrIDA3NTUgcm9vdCByb290IC0K
IEwgL3Zhci9sb2NrIC0gLSAtIC0gLi4vcnVuL2xvY2sKLXslIGlmIENSRUFURV9MT0dfRElSUyAl
fQotTCAvdmFyL2xvZy9SRUFETUUgLSAtIC0gLSAuLi8uLnt7RE9DX0RJUn19L1JFQURNRS5sb2dz
Ci17JSBlbmRpZiAlfQogCiAjIC9ydW4vbG9jay9zdWJzeXMgaXMgdXNlZCBmb3Igc2VyaWFsaXpp
bmcgU3lzViBzZXJ2aWNlIGV4ZWN1dGlvbiwgYW5kCiAjIGhlbmNlIHdpdGhvdXQgdXNlIG9uIFN5
c1YtbGVzcyBzeXN0ZW1zLgotLSAKMi4zNC4xCgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5087</attachid>
            <date>2024-12-12 10:24:05 +0000</date>
            <delta_ts>2024-12-12 10:24:05 +0000</delta_ts>
            <desc>enable create-log-dirs</desc>
            <filename>0001-systemd-enable-create-log-dirs.patch</filename>
            <type>text/plain</type>
            <size>1647</size>
            <attacher name="Changqing Li">changqing.li</attacher>
            
              <data encoding="base64">RnJvbSBhNzliYjg1ZjE4NzFmMTc0MjEyOWVjN2RkNTY4YmFjZWY4NjQ5NzUxIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBDaGFuZ3FpbmcgTGkgPGNoYW5ncWluZy5saUB3aW5kcml2ZXIu
Y29tPgpEYXRlOiBUaHUsIDEyIERlYyAyMDI0IDE4OjE2OjU3ICswODAwClN1YmplY3Q6IFtQQVRD
SF0gc3lzdGVtZDogZW5hYmxlIGNyZWF0ZS1sb2ctZGlycwoKd2UgZGlzYWJsZSBjcmVhdGUtbG9n
LWRpcnMgZm9yIGZpeGluZyBkZWFkIGxpbmsgL3Zhci9sb2cvUkVBRE1FLApidXQgdGhpcyBtYWtl
IHN5c3RlbWQgbG9nIGFsd2F5cyBub24gcGVyc2lzdGVudCwgZXZlbnQgd2UgZG9uJ3QKc2V0IHZv
bGF0aWxlIGxvZywgdW5sZXNzIHVzZXIgdG8gY2hhbmdlIGpvdXJuYWxkLmNvbmYsIG1ha2UKIlN0
b3JhZ2UiIHRvICJwZXJzaXN0ZW50Ii4KCnNvIHJlZW5hYmxlIGNyZWF0ZS1sb2ctZGlycywgYW5k
IHNpbmNlIFJFQURNRSBpcyBub3QgdmVyeSB1c2VyZnVsLApqdXN0IHJlbW92ZSBpdC4KClNpZ25l
ZC1vZmYtYnk6IENoYW5ncWluZyBMaSA8Y2hhbmdxaW5nLmxpQHdpbmRyaXZlci5jb20+Ci0tLQog
bWV0YS9yZWNpcGVzLWNvcmUvc3lzdGVtZC9zeXN0ZW1kXzI1Ni44LmJiIHwgNSArKysrLQogMSBm
aWxlIGNoYW5nZWQsIDQgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBh
L21ldGEvcmVjaXBlcy1jb3JlL3N5c3RlbWQvc3lzdGVtZF8yNTYuOC5iYiBiL21ldGEvcmVjaX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jaF9saWJkaXJ9L3RtcGZpbGVzLmQvbGVnYWN5LmNvbmYKKwlmaQogfQog
CiBweXRob24gcG9wdWxhdGVfcGFja2FnZXM6cHJlcGVuZCAoKXsKLS0gCjIuMjUuMQoK
</data>

          </attachment>
      

    </bug>

</bugzilla>