#836399 syncevolution: please check for XDG_RUNTIME_DIR/bus before running dbus-launch

#836399#5
Date:
2016-09-02 15:30:05 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.
mopidy-dleyna currently runs dbus-launch in both syncevo-http-server.py
and test/dbus-session.sh if DBUS_SESSION_BUS_ADDRESS is unset.

One issue with this approach in syncevo-http-server.py 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_BUS_ADDRESS is unset is to look for $XDG_RUNTIME_DIR/bus:
if the environment variable is 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.  syncevo-http-server.py should not run
dbus-launch without first looking for that socket.

Another issue with the approach this package has taken, in both
places, 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://github.com/flatpak/flatpak/commit/6cc8062cfb3f9410d54a27e7ccca77c103e441e8>.
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. In particular, this would be appropriate
for test/dbus-session.sh to do.

One way to deal with syncevo-http-server.py would be for this package to
stop trying to compensate for a missing session bus address at all. On
systems with $XDG_RUNTIME_DIR/bus, it would "just work" anyway; or when
run under X11 (even with no dbus-daemon running), X11 autolaunching
would create a dbus-daemon anyway; or if it is being run in a non-GUI
environment like cron, its documentation could mention that this may
require either setting DISPLAY, or running

    dbus-run-session -- syncevo-http-server ...

which has been available since dbus 1.8, and automatically cleans up
the dbus-daemon after syncevo-http-server terminates (successfully
or not). It is not really syncevo-http-server.py's job to set up D-Bus.

In Debian, a dependency on default-dbus-session-bus | dbus-session-bus
is an appropriate way to make sure that at least X11 login sessions,
and sometimes non-X11 login sessions too, will have a D-Bus session
bus available without the need to take special steps.

This is really mostly 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

#836399#10
Date:
2016-09-02 16:52:22 UTC
From:
To:
I can make that change upstream in the new upstream release that I am
currently working on. However, I would keep the old behavior as
something that can be requested if needed because....

... SyncEvolution still tries to support old systems where these new
features are not available.

#836399#15
Date:
2016-09-02 16:52:22 UTC
From:
To:
I can make that change upstream in the new upstream release that I am
currently working on. However, I would keep the old behavior as
something that can be requested if needed because....

... SyncEvolution still tries to support old systems where these new
features are not available.

#836399#20
Date:
2019-08-25 00:50:57 UTC
From:
To:
Dear submitter,

as the package syncevolution has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/935239

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)