Bug 15779

Summary: dbus: systemd unit files are included even if systemd is disabled
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Zixun Li <zli>
Component: coreAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: daisuke.yamane, meta.mr.watcher, meta.watcher, randy.macleod, ross.burton
Version: 5.0.7   
Target Milestone: 5.0.15   
Hardware: All   
OS: arm   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Zixun Li 2025-03-04 17:16:45 UTC
Hi,

In yocto-5.0.7-57-g2afaed1013, systemd unit files of dbus are included in packages even if systemd is disabled in distro features:

oe-pkgdata-util list-pkg-files dbus
dbus:
        /etc/default/volatiles/99_dbus
        /etc/init.d/dbus-1
        /usr/bin/dbus-cleanup-sockets
        /usr/bin/dbus-daemon
        /usr/bin/dbus-launch
        /usr/bin/dbus-run-session
        /usr/lib/systemd/user/dbus.service
        /usr/libexec/dbus-daemon-launch-helper

oe-pkgdata-util list-pkg-files dbus-common
dbus-common:
        /etc/dbus-1/session.conf
        /etc/dbus-1/system.conf
        /usr/lib/systemd/user/dbus.socket
        /usr/lib/systemd/user/sockets.target.wants/dbus.socket
        /usr/share/dbus-1/session.conf
        /usr/share/dbus-1/system.conf
Comment 1 Randy MacLeod 2025-03-06 15:39:29 UTC
Either delete the files or find a better fix.
Comment 2 Ross Burton 2025-03-06 15:45:09 UTC
The ideal solution would be to inhert the systemd class, but I fear that there might be circular dependencies if this happens.

So I'd suggest trying to inherit the systemd class, and if that fails then manually do the cleanup in do_install().
Comment 3 daisuke.yamane 2025-06-17 04:03:12 UTC
When I tried to build dbus with yocto-5.2, I found that the service and socket files were not contained in the package.

$ oe-pkgdata-util list-pkg-files dbus dbus-common
dbus:
	/etc/default/volatiles/99_dbus
	/etc/init.d/dbus-1
	/usr/bin/dbus-cleanup-sockets
	/usr/bin/dbus-daemon
	/usr/bin/dbus-launch
	/usr/bin/dbus-run-session
	/usr/libexec/dbus-daemon-launch-helper
dbus-common:
	/etc/dbus-1/session.conf
	/etc/dbus-1/system.conf
	/usr/share/dbus-1/session.conf
	/usr/share/dbus-1/system.conf

It is possible that the issue has been fixed with an update to dbus.
Comment 4 Ross Burton 2025-06-17 09:36:45 UTC
Moving target, as this is fixed in recent releases.
Comment 5 Randy MacLeod 2026-04-09 15:23:33 UTC
Works on master. 
If you want to send patches to fix this on older releases, please do so.