diff mbox series

util-linux: fix uuidd failed with /run/uuidd not found

Message ID 20251022132307.2905011-1-hongxu.jia@windriver.com
State New
Headers show
Series util-linux: fix uuidd failed with /run/uuidd not found | expand

Commit Message

Hongxu Jia Oct. 22, 2025, 1:23 p.m. UTC
It failed to run uuidd
...
root@qemux86-64:~# uuidd
uuidd: cannot open /run/uuidd/uuidd.pid: No such file or directory
...

Create dir /run/uuidd for both of systemd and sysvinit

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../util-linux/util-linux_2.41.1.bb           | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Alexander Kanavin Oct. 23, 2025, 11:03 a.m. UTC | #1
On Wed, 22 Oct 2025 at 15:23, hongxu via lists.openembedded.org
<hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
>
> It failed to run uuidd
> ...
> root@qemux86-64:~# uuidd
> uuidd: cannot open /run/uuidd/uuidd.pid: No such file or directory
> ...
>
> Create dir /run/uuidd for both of systemd and sysvinit

The commit does quite a bit more than this, and I think a bit of
further research is needed.

> +    /etc/tmpfiles.d/uuidd.conf \
> +    /etc/default/volatiles/99_uuidd \

 Specifically, how are these this handled in common binary distros?
What do Debian/Fedora do? Presumably they contain the same files in
the root filesystem, how and when those are created?


> +pkg_postinst:${PN}-uuidd() {
> +       if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
> +               ${sysconfdir}/init.d/populate-volatile.sh update
> +       fi
> +}

What is this for? Why does it need to be run? Why is it conditional on
both $D and existence of the file it wants to run?

> +       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
> +               install -d ${D}${sysconfdir}/tmpfiles.d
> +               echo "d /run/uuidd 0755 root root - -" > ${D}${sysconfdir}/tmpfiles.d/uuidd.conf
> +       fi
> +
> +       if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
> +               install -d ${D}${sysconfdir}/default/volatiles
> +               echo "d root root 0755 /run/uuidd none" > ${D}${sysconfdir}/default/volatiles/99_uuidd
> +       fi

This looks like it should be solved with a patch to upstream, but
again, first we need to find out what binary distros do.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-core/util-linux/util-linux_2.41.1.bb b/meta/recipes-core/util-linux/util-linux_2.41.1.bb
index 08bca065b2..84c6d90b3f 100644
--- a/meta/recipes-core/util-linux/util-linux_2.41.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.41.1.bb
@@ -183,6 +183,10 @@  FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 FILES:${PN}-mount = "${sysconfdir}/default/mountall"
 FILES:${PN}-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES:${PN}-su = "${sysconfdir}/pam.d/su-l"
+FILES:${PN}-uuidd = " \
+    /etc/tmpfiles.d/uuidd.conf \
+    /etc/default/volatiles/99_uuidd \
+"
 CONFFILES:${PN}-su = "${sysconfdir}/pam.d/su-l"
 FILES:${PN}-lastlog2 += "${base_libdir}/security/pam_lastlog2.so \
                          ${nonarch_libdir}/tmpfiles.d/lastlog2.conf \
@@ -226,6 +230,12 @@  do_compile:prepend () {
 	[ -e ${S}/libsmartcols/src/filter-parser.c ] && touch ${S}/libsmartcols/src/filter-parser.c
 }
 
+pkg_postinst:${PN}-uuidd() {
+	if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
+		${sysconfdir}/init.d/populate-volatile.sh update
+	fi
+}
+
 do_install:append () {
 	mkdir -p ${D}${base_bindir}
 
@@ -279,6 +289,16 @@  do_install:append:class-target () {
 				> ${D}${sysconfdir}/default/volatiles/99_lastlog2
 		fi
 	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/tmpfiles.d
+		echo "d /run/uuidd 0755 root root - -" > ${D}${sysconfdir}/tmpfiles.d/uuidd.conf
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/default/volatiles
+		echo "d root root 0755 /run/uuidd none" > ${D}${sysconfdir}/default/volatiles/99_uuidd
+	fi
 }
 # nologin causes a conflict with shadow-native
 # kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir})