[systemd-devel] mate desktop user service file

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Dec 4 04:53:52 PST 2014

On 04/12/14 08:56, arnaud gaboury wrote:
> For reasons I ignore (far from being a dbus expert), the
> $DBUS_SESSION_BUS_ADDRESS as returned by the
> $systemctl --user show-environment did not work for mate-settings-daemon.
> $systemctl --user show-environment returns
> DBUS_SESSION_BUS_ADDRESS=/run/user/1000/dbus/user_bus_socket

You can ignore those reasons as much as you like, but ignoring them is
not going to make them go away.

You seem to be using some mechanism for starting 'systemd --user' that
gives it a DBUS_SESSION_BUS_ADDRESS that assumes dbus-daemon is being
started via a specific third-party implementation of a dbus.service for
the user bus, possibly from "user-session-units". If you use the part of
user-session-units that assumes a dbus-daemon will be launched, but not
the part that actually launches the dbus-daemon, then I'm afraid you get
to keep both pieces.

Neither dbus nor systemd currently ships that dbus.service. When I
suggested adding one to dbus, Lennart asked me to use a different path
for the socket, then said he had no plans to support a non-kdbus user
bus at all ... so that feature request is on hold.
(https://bugs.freedesktop.org/show_bug.cgi?id=61301 if you're interested.)

Find what is setting DBUS_SESSION_BUS_ADDRESS, and make it not do that.

> So adding EnvironmentFile=%h/.dbus/session-bus/77f348a2b3fb429b85a5de751ea9175a-0
> solved the issue.

FYI, 77f... is your D-Bus machine ID, found in /var/lib/dbus/machine-id
or /etc/machine-id.

> 154:gabx      1424     1  0 Nov29 ?        00:00:00 dbus-launch
> --autolaunch=77f348a2b3fb429b85a5de751ea9175a --binary-syntax
> --close-stderr
> Why this autolaunch ?

autolaunch is a mechanism to start a dbus-daemon per (machine, X11
display) pair when no dbus-daemon is running and an application tries to
connect to D-Bus. It mostly works via X11 properties; the files in
~/.dbus are a fallback.

If mate-settings-daemon can connect to X11 (a correct DISPLAY and
XAUTHORITY) and *does not* have DBUS_SESSION_BUS_ADDRESS in its
environment, it will use the autolaunch mechanism to get a bus.

Normally, Linux distributions and desktop environments also ensure that
a dbus-daemon is running for each X11 session. Since you seem to have
constructed your own desktop environment out of pieces, it's up to you
to decide how you launch your dbus-daemon and communicate its address to
the right places; autolaunch is the fallback mechanism for if you don't.


More information about the systemd-devel mailing list