Created attachment 5086 [details] Suggestion for systemd upstream fix when bug is confirmed in Yocto 18d46e11d85d ("systemd: fix dead link /var/log/README") 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 "fix" 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 = "1" 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.
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't have time to check right now, sorry.
@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 ("systemd: fix dead link /var/log/README") The attached patch is the same as the V1 patch.
Circumventing this issue for creating the /var/log/journal can be done by configuring journald.conf to make the storage persistent. See Options, "Storage" in https://man7.org/linux/man-pages/man5/journald.conf.5.html Wouldn'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.
There is behavior change after disabling create-log-dirs: when create-log-dirs is enabled, /var/log/journal will be created, and since "Storage" in journald.conf is default "Auto", when it defects exist of "/var/log/journal", 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 "FILESYSTEM_PERMS_TABLES" 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 "Storage" in journald.conf is default "Auto", 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 "Storage" to "persistent" in journald.conf, then /var/log/journal will be created to store log. Then distro level config "FILESYSTEM_PERMS_TABLES" 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't create it, Attached the RFC patch. @Richard, @Khem, what's your opinion?
Created attachment 5087 [details] enable create-log-dirs
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.
enable create-log-dirs in this commit: https://git.openembedded.org/openembedded-core/commit/?id=f82d9c997ba8cc23b472d44a43489c597bf452af