You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use the existing user D-Bus session ($XDG_RUNTIME_DIR/bus) instead of spawning dbus-launch #210
require_dbus_session() in cinnamon-session/main.c only checks the DBUS_SESSION_BUS_ADDRESS environment variable: if it is unset, it re-execs
itself under dbus-launch --exit-with-session, even when a user D-Bus session
bus is already running at $XDG_RUNTIME_DIR/bus (the default on any systemd
system, and also with elogind + dbus configured for the user bus).
This spawns a second session bus, separate from the user bus: D-Bus
activated services and portals end up split across the two buses. On systems
without the dbus-launch binary (Debian with only dbus-user-session
installed) the session fails to start entirely.
X11 logins are usually unaffected because display managers wrap the session
with a script that exports DBUS_SESSION_BUS_ADDRESS (e.g. /etc/X11/Xsession.d/20dbus_xdg-runtime on Debian-based distros). But the
Wayland session (cinnamon-session-cinnamon --wayland) does not go through
those wrappers, so whether the fallback triggers depends on the display
manager. It is also easy to demonstrate directly:
re-execs under dbus-launch and spawns a new dbus-daemon --session just to
print the version.
Suggested fix
Do what current gnome-session does (gnome-session/leader-main.c): ask GDBus
for the session bus address before falling back to dbus-launch. GDBus already
falls back to $XDG_RUNTIME_DIR/bus when the variable is unset (GLib >= 2.50):
Exporting the variable keeps every child process of the session on the same
bus. The dbus-launch path would remain as a last resort, so nothing changes
for setups without a user bus.
Originally reported in Debian in 2016 as part of a cross-desktop effort to
reduce reliance on dbus-launch: https://bugs.debian.org/835846 (gnome-session
dropped dbus-launch entirely; the check described there — a socket at $XDG_RUNTIME_DIR/bus owned by the current uid — is what the GDBus call
implements).
PR done, include also a commit with updating glib version require and another commit for a bug spotted testing the first commit.
As seen from the tests, it's unlikely to have problems (for the lack of this PR), except for derivatives and other distros without systemd. But it might be better anyway in case of possible future changes, as I think Simon McVittie intended.
Activity
mtwebster commentedon Jul 26, 2026
Sounds good, thanks
Fantu commentedon Aug 7, 2026
PR done, include also a commit with updating glib version require and another commit for a bug spotted testing the first commit.
As seen from the tests, it's unlikely to have problems (for the lack of this PR), except for derivatives and other distros without systemd. But it might be better anyway in case of possible future changes, as I think Simon McVittie intended.
main.c: Use the existing user D-Bus session bus instead of spawning d…
Use the existing user D-Bus session bus instead of spawning dbus-laun…