#835846 cinnamon-session: don't run dbus-launch if XDG_RUNTIME_DIR/bus is available

Package:
src:cinnamon-session
Source:
cinnamon-session
Submitter:
Simon McVittie
Date:
2026-10-16 19:51:05 UTC
Severity:
normal
Tags:
#835846#5
Date:
2016-08-28 18:16:18 UTC
From:
To:
As described in <https://lists.debian.org/debian-devel/2016/08/msg00554.html>
I'm trying to reduce how much dbus-launch is used in Debian.
cinnamon-session has code inherited from gnome-session that explicitly
runs dbus-launch if DBUS_SESSION_BUS_ADDRESS isn't set.

The major D-Bus implementations (libdbus, GDBus, sd-bus) now have a
fallback code path, before trying X11 autolaunch, when
DBUS_SESSION_BUS_ADDRESS is unset: if XDG_RUNTIME_DIR is set, and
XDG_RUNTIME_DIR/bus exists, is a socket and is owned by the
process's uid, then they will use it. In particular, dbus-user-session
sets up that situation.

For the moment, dbus-user-session does make sure DBUS_SESSION_BUS_ADDRESS
is set, to be nice to packages that don't have this fallback path.
However, I'd like to avoid requiring that in future, by adapting
the dbus-launch code in gnome-session and its forks to look for
XDG_RUNTIME_DIR/bus before trying dbus-launch.

It's probably best if this happens in gnome-session first (I'll
open the upstream bug after I've finished with this MBF), then gets
cherry-picked into the GNOME derivatives like Cinnamon.

Thanks,
    S

#835846#10
Date:
2022-06-17 18:29:36 UTC
From:
To:
Il 28/08/2016 20:16, Simon McVittie ha scritto:
Hi, from a fast search I not found change/remove use of dbus-launch
upstream and also in gnome-session. Have you did something related to
this I not found?

Thanks for any reply

#835846#15
Date:
2026-07-18 19:35:00 UTC
From:
To:
Thanks for report this, rechecked now, I did a fast test on xorg and
didn't cause problem but can be on wayland that will be more used from
next cinnamon version (out of experimental) so I started to report it
upstream.

#835846#20
Date:
2026-08-07 18:59:37 UTC
From:
To:
Hello,

Bug #835846 in cinnamon-session reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/cinnamon-team/cinnamon-session/-/commit/12281d6e45e3496b94a32cb97243c7bcd642407c
------------------------------------------------------------------------
d/patches: use the running user D-Bus session bus instead of dbus-launch

require_dbus_session() only looked at DBUS_SESSION_BUS_ADDRESS, so with
the variable unset cinnamon-session re-exec'd itself under `dbus-launch
--exit-with-session` even when the user already had a session bus
running on the well-known socket at $XDG_RUNTIME_DIR/bus. That starts a
second bus, splitting activatable services and portals across the two,
and with only dbus-user-session installed (no dbus-launch binary) the
session does not start at all. X11 logins usually escape this because
the display manager wraps the session in a script that exports
DBUS_SESSION_BUS_ADDRESS, but the Wayland session does not go through
those wrappers.

The first patch asks GDBus for the session bus address (it looks for the
socket at $XDG_RUNTIME_DIR/bus since GLib 2.50) and exports it, so every
child of the session ends up on the same bus; the dbus-launch fallback
stays for setups without a user bus. Same approach as gnome-session in
leader-main.c.

The second patch fixes the fallback itself: `if (!execvp (...))` was
never true, since execvp() returns only on failure and then always -1,
so the "No session bus and could not exec dbus-launch" error was dead
code and the session silently carried on with no bus at all. Both
patches come from linuxmint/cinnamon-session#212.

Tested in a sid chroot: with a bus on $XDG_RUNTIME_DIR/bus the patched
binary no longer execs dbus-launch while the archive build does; with no
user bus the dbus-launch fallback still starts a session bus as before;
and with neither, the session now aborts with the error message instead
of continuing without a bus.

Closes: #835846

Assisted-by: Claude Code:claude-opus-5
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/835846

#835846#29
Date:
2026-10-16 19:49:26 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
cinnamon-session, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 835846@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fabio Fantoni <fantonifabio@tiscali.it> (supplier of updated cinnamon-session package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 16 Oct 2026 21:28:13 +0200
Source: cinnamon-session
Built-For-Profiles: noudeb
Architecture: source
Version: 6.6.4-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Cinnamon Team <debian-cinnamon@lists.debian.org>
Changed-By: Fabio Fantoni <fantonifabio@tiscali.it>
Closes: 835846 1107963 1107965
Changes:
 cinnamon-session (6.6.4-2) unstable; urgency=medium
 .
   * d/patches:
     - use the running user D-Bus session bus instead of dbus-launch
     (Closes: #835846)
     - main.c-Report-the-failure-when-dbus-launch-cannot-be-exec.patch
     - take the session's logind inhibitor in block-weak mode
     (Closes: #1107963, #1107965)
   * d/rules: include architecture.mk
Checksums-Sha1:
 8c570db31f09ab2eb7ac37e2be741ed582973247 2655 cinnamon-session_6.6.4-2.dsc
 c98b818b3cba5d4cc72dd24e1ae954a4cad5906b 158177 cinnamon-session_6.6.4.orig.tar.gz
 4ca2166f0410f92a30e7a887aa801273c3489333 12164 cinnamon-session_6.6.4-2.debian.tar.xz
 b92dc6fb1dddfa34851fe4765c447f9ee2f533db 8360 cinnamon-session_6.6.4-2_source.buildinfo
Checksums-Sha256:
 fc7e41c414e60ccde162400493b445ecc298c7e6633fff5f4cf6b4019e21ed24 2655 cinnamon-session_6.6.4-2.dsc
 8fc66c06622ccf834a503df79ae70a2fb6732b6f07b37435cedaa7d1c4154912 158177 cinnamon-session_6.6.4.orig.tar.gz
 76c1141808204c33bcb905db09b92392e5b518f3abe3773d43affb6090046bfa 12164 cinnamon-session_6.6.4-2.debian.tar.xz
 1ee12648ea7b11c31e452960ba0287813bb7db827d117861c0879a7e7c3eea8c 8360 cinnamon-session_6.6.4-2_source.buildinfo
Files:
 e2f15e4ec2341bd6fa31ba4b2d8fa664 2655 x11 optional cinnamon-session_6.6.4-2.dsc
 6b0f341593ff026533c281a7980b0797 158177 x11 optional cinnamon-session_6.6.4.orig.tar.gz
 df63bc3dfc5e09f8cd254f0e1ca7c1f0 12164 x11 optional cinnamon-session_6.6.4-2.debian.tar.xz
 1f78c2a90bf4fc8bed5cd26967ab7468 8360 x11 optional cinnamon-session_6.6.4-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEELEHRfLe4S9D5+1GzaAZorpB/EB0FAmrSezcACgkQaAZorpB/
EB39HQ//c5Jx9m+2A+BlFud6YQJnPqlbmfOO3HEQsh4dyGTE2EOf7Wi5WdR433aU
eC+MglnSvL/bTELOObaFIzZ/1xMU2eGoKG9Te723M2kwCQoriEscqRhHkDC1PbzK
UdiXUO4u4hoBNY+czpDjqWAXOlYvGIMoaohGmlJQRHW7wP06nm+fYNWj1j0XR4Hn
VQ+HVbMvbXqPLpOhwOLr8mV9HcsB16hztjBtPKRjVGw8dNDxPuOkFtDuEGLElAL+
Ct58BptHLAVT4v7Nn4N1KCyGGGuGERBKUEidCa2yrVxxVLIG7E2R4dy6PSxihfT3
vAM1rAPk4tJOR5h1DgB9UqSUBSoWiFrmLTpJPQTO+fnXuDy/ZLv87gxM3vfek3mt
1UXsMb05/KFqk5SPr4tZpiSWu7LWi4JbbhBXoFuyqUXySH/exVISZuDq6CccH8IL
1YI4N/E2Mt4MwlfHZ7IdGEPQ+sAEDg6Zt+0CXysNk7cT3K3lnBMU8PYjU4YnWOQv
jLKMHCeOko2O34VbV5SiNqr8JVkACxozbzUEGqr0iRytUOuP4OofcizRXBvJsP6d
h4fX6wsZg/9909EsReWlr0AZTn4IF70sM3I9deuT1qfGGdYXoorRr2ITUbUYbZ8F
0LZ1Eku2KUWqmqy/nzWA6ezzsx9V4RP+axkXOQtjOHJQsfB4wwM=
=gnik
-----END PGP SIGNATURE-----