[systemd-devel] comments on setting DBus addresses in pam_systemd

Mantas Mikulėnas grawity at gmail.com
Fri Jan 10 12:56:20 PST 2014


I realize this sounds more like a blag post, but I thought I'd share anyway.

So I noticed that a few recent commits have moved setting of
$DBUS_SESSION_BUS_ADDRESS from the user at .service unit file to
pam_systemd, which makes the "user bus" available by default to all
login sessions.

It's something I wanted to try out locally for a long time – I had the
relevant `export …` in ~/.profile but never did uncomment it. But,
after installing the latest systemd-git and rebooting, it turned out
that this actually breaks more things than expected.

Specifically: a few GNOME programs rely completely on DBus activation
– for example, `/usr/bin/gnome-terminal` is nowadays a thin wrapper
that only activates gnome-terminal-server and calls CreateInstance()
there. (And while I don't understand _at all_ how the gapplication
stuff works, _it seems_ that `/usr/bin/gnome-weather` similarly just
dbus-activates the real program…)

And since the "user bus" dbus-daemon has no knowledge of $DISPLAY or
$XAUTHORITY, this breaks such programs completely – e.g. trying to
open a terminal from GNOME Shell just silently logs an error "Cannot
open display: (null)" to the journal. (xterm still works, of course.)

I could work around this by calling `systemctl --user set-environment
DISPLAY="$DISPLAY"` from my ~/.xprofile, or by applying the
"user-session-patches" that make xlib use
$XDG_RUNTIME_DIR/X11-display… (although this would still mean I'd lose
a bunch of environment variables like $PATH, $EDITOR, $GTK_IM_MODULE,
and so on, which are set from ~/.profile, but at least it would make
things work again.)

Currently I just commented out that part of pam_systemd on my own
machine, to let gnome-session start a session dbus-daemon as
previously. So, uh, in conclusion... maybe it's not wise to export the
user bus for everyone in v209 just yet. :|

Any comments from GNOME developers?

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list