Install lastlog2 volatile file to create /var/lib/lastlog directory to
fix runtime error:

$ lastlog2
lastlog2: Couldn't read entries for all users
lastlog2: Cannot open database (/var/lib/lastlog/lastlog2.db): unable to open 
database file

Signed-off-by: Yi Zhao <yi.z...@windriver.com>
---
 meta/recipes-core/util-linux/util-linux_2.40.1.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux_2.40.1.bb 
b/meta/recipes-core/util-linux/util-linux_2.40.1.bb
index b70d97a934..a1aab94055 100644
--- a/meta/recipes-core/util-linux/util-linux_2.40.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.40.1.bb
@@ -118,7 +118,8 @@ FILES:${PN}-mount = "${sysconfdir}/default/mountall"
 FILES:${PN}-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES:${PN}-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES:${PN}-su = "${sysconfdir}/pam.d/su-l"
-FILES:${PN}-lastlog2 += "${base_libdir}/security/pam_lastlog2.so"
+FILES:${PN}-lastlog2 += "${base_libdir}/security/pam_lastlog2.so \
+                         ${nonarch_libdir}/tmpfiles.d/lastlog2.conf"
 FILES:${PN}-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
                           ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
                           ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
@@ -205,6 +206,12 @@ do_install:append:class-target () {
                # otherwise it uses "other", which has "auth pam_deny.so"
                # and thus prevents the operation.
                ln -s su ${D}${sysconfdir}/pam.d/su-l
+
+               if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 
'false', d)}; then
+                       install -d ${D}${nonarch_libdir}/tmpfiles.d
+                       install -m 0644 
${S}/misc-utils/lastlog2-tmpfiles.conf.in \
+                               ${D}${nonarch_libdir}/tmpfiles.d/lastlog2.conf
+               fi
        fi
 }
 # nologin causes a conflict with shadow-native
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#202289): 
https://lists.openembedded.org/g/openembedded-core/message/202289
Mute This Topic: https://lists.openembedded.org/mt/107452590/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to