diff mbox series

[v3,1/2] dbus: Package dbus-daemon separately from the system bus units

Message ID 20261102151805.3233815-1-khem.raj@oss.qualcomm.com
State Under Review
Headers show
Series [v3,1/2] dbus: Package dbus-daemon separately from the system bus units | expand

Commit Message

Khem Raj Nov. 2, 2026, 3:18 p.m. UTC
dbus-daemon is also used to run private buses, e.g. by GLib's GTestDBus
and python-dbusmock in test suites. It is currently in the dbus package
together with the system bus service units, which conflicts with other
system bus implementations: dbus-broker RCONFLICTS dbus, so with
VIRTUAL-RUNTIME_dbus = "dbus-broker" no dbus-daemon can be installed and
such tests fail with

  Error spawning dbus-daemon: Failed to spawn child process "dbus-daemon" (No such file or directory)

Move dbus-daemon, dbus-run-session and dbus-cleanup-sockets into a new
dbus-daemon package, similar to Debian, which can be installed alongside
dbus-broker.

dbus RDEPENDS on it, so nothing changes for existing users.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta/recipes-core/dbus/dbus_1.16.2.bb | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/dbus/dbus_1.16.2.bb b/meta/recipes-core/dbus/dbus_1.16.2.bb
index c7815d78f7..e602c67727 100644
--- a/meta/recipes-core/dbus/dbus_1.16.2.bb
+++ b/meta/recipes-core/dbus/dbus_1.16.2.bb
@@ -50,7 +50,7 @@  PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
 PACKAGECONFIG[tests] = "-Dmodular_tests=enabled -Dinstalled_tests=true,-Dmodular_tests=disabled -Dinstalled_tests=false,glib-2.0"

 DEPENDS = "virtual/libintl"
-RDEPENDS:${PN} += "${PN}-common ${PN}-tools"
+RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'message-bus', '${PN}-daemon', '', d)} ${PN}-common ${PN}-tools"
 RDEPENDS:${PN}:class-native = ""

 inherit systemd useradd update-rc.d
@@ -58,7 +58,7 @@  inherit systemd useradd update-rc.d
 INITSCRIPT_NAME = "dbus-1"
 INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."

-PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools"
+PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-daemon ${PN}-tools"

 USERADD_PACKAGES = "dbus-common"
 USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \
@@ -69,10 +69,7 @@  CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session

 DEBIANNAME:${PN} = "dbus-1"

-FILES:${PN} = "${bindir}/dbus-daemon* \
-               ${bindir}/dbus-cleanup-sockets \
-               ${bindir}/dbus-launch \
-               ${bindir}/dbus-run-session \
+FILES:${PN} = "${bindir}/dbus-launch \
                ${libexecdir}/dbus* \
                ${sysconfdir} \
                ${localstatedir} \
@@ -93,6 +90,14 @@  FILES:${PN}-common = "${sysconfdir}/dbus-1 \
                       ${systemd_user_unitdir}/sockets.target.wants \
                       ${nonarch_libdir}/sysusers.d/dbus.conf \
 "
+# The message bus executable on its own, without the system bus units, so that
+# it can be installed next to another system bus implementation (dbus-broker)
+# for things like test suites which start private buses.
+FILES:${PN}-daemon = "${bindir}/dbus-daemon* \
+                      ${bindir}/dbus-cleanup-sockets \
+                      ${bindir}/dbus-run-session \
+"
+RDEPENDS:${PN}-daemon = "${PN}-common"
 FILES:${PN}-tools = "${bindir}/dbus-uuidgen \
                      ${bindir}/dbus-send \
                      ${bindir}/dbus-monitor \