[systemd-devel] [PATCH] Delay dbus connection for user session
Lennart Poettering
lennart at poettering.net
Thu Jun 20 11:58:54 PDT 2013
On Wed, 19.06.13 20:58, Kok, Auke-jan H (auke-jan.h.kok at intel.com) wrote:
> >> Yes, just in that case. If all of you agreed, I'd like submit a V2 to
> >> drop these lines.
> >
> > Hmm, this would break my usual testing routine, where i run user systemd
> > against a bus daemon that is already running... I have no doubt that
> > dropping the check entirely is the right way to go eventually, but maybe
> > we can find a better way so that this continues to work for me until
> > GNOME has switched over to systemd as service manager.
>
> I'm kinda dumb for not thinking this over, but, if you already have a
> dbus-daemon running, you have DBUS_SESSION_BUS_ADDRESS set.
>
> So, the whole idea of connection to a session bus if
> DBUS_SESSION_BUS_ADDRESS is unset makes no sense whatsoever.
>
> Lennart, would you agree that we could just do something like:
>
> if (getenv("DBUS_SESSION_BUS_ADDRESS"))
> // attempt to init dbus early
> else
> // debug message printing out that an attempt to connect to an
> existing session bus was not done
>
> I think that solves your use case, and will remove the whole dbus init
> attempt for folks running under a user session where this is not
> needed.
Indeed. Happy to take such a patch!
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list