Avoid moonshot-dbus-launch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Moonshot ID Selector |
Confirmed
|
Wishlist
|
Unassigned | ||
moonshot-ui (Debian) |
Confirmed
|
Unknown
|
Bug Description
In debian bug #836116, I received the following comments about our moonshot-
As described in <https:/
I'm trying to reduce how much dbus-launch is used in Debian.
moonshot-ui currently runs dbus-launch via moonshot-
if DBUS_SESSION_
One issue with this approach is that it second-guesses how the D-Bus
client implementation itself will find the session bus. In recent libdbus
and GDBus, the fallback behaviour if DBUS_SESSION_
is to look for $XDG_RUNTIME_
set, that directory contains ./bus, and ./bus is a socket owned by
the current uid, then libdbus and GDBus will automatically use it. In
particular, the dbus-user-session Debian package sets up this situation.
moonshot-
for that socket.
Another issue with the approach moonshot-ui has taken is that it relies
on dbus-launch, which is X11-specific legacy code that does several
things, none of them particularly well.
This Flatpak commit illustrates how eval `dbus-launch` can be replaced
by invoking dbus-daemon directly, avoiding the X11-specific dbus-launch:
<https:/
It is possible to send both the address and the pid to stdout
("--print-address=1 --print-pid=1") if that would be easier to deal
with; their order is undocumented but predictable, and I don't intend
to break it in future D-Bus releases.
Alternatively, and perhaps most simply, moonshot-ui could stop trying to
compensate for a missing session bus address at all. On systems with
$XDG_RUNTIME_
(even with no dbus-daemon running), X11 autolaunching would create a
dbus-daemon anyway; or if moonshot-ui is being run in a non-GUI
environment (can that even make sense?), its documentation could mention
that this requires using
dbus-
which has been available since dbus 1.8, and automatically cleans up
the dbus-daemon after COMMAND terminates (successfully or not).
This is really an upstream bug. If you forward it upstream, please
quote the full text of this bug report and let upstream make their
own decisions.
Thanks,
S
Changed in moonshot-ui (Debian): | |
status: | Unknown → Confirmed |
Changed in moonshot-ui: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
As I told Simon, I'm not sure that we actually fail to respect XDF_RUNTIME_DIR/bus because of the way the dbus_connect function works in libmoonshot/ libmoonshot- dbus.c. However, I do think that launching the daemon directly might make a lot more sense than using the shell script we have.