Starting DBus from gnome-session instead of Xsession

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Starting DBus from gnome-session instead of Xsession

Loïc Minier
        Hi,

 The session DBus in Debian Xsessions is currently started by
 /etc/X11/Xsession.d/75dbus_dbus-launch if the use-session-dbus option
 is set.

 Newer gnome-session will spawn a session DBus automatically if none has
 been started.

 If gnome-session launches DBus, DBus will inherit env from
 gnome-session which is handy for gnome-keyring for example.

 I suspect we wouldn't suffer from the sound issues (the desktop sounds
 are not working bugs) would we be moving to launch DBus from
 gnome-session, and I think this is what we should aim to do.


 I personally think it makes a lot of sense to launch DBus from
 gnome-session; what I wonder about is how we're going to switch to this
 setup.
   Ubuntu plans to fix this via a patch to the dbus Xsession snippet to
 avoid starting DBus when running GNOME session; see Ubuntu #62163 and
 <http://librarian.launchpad.net/7170382/dbus_1.0.2-1ubuntu34.patch>.
   It's not trivial to know whether we're really in a GNOME session
 because:
 - from the PoV of gdm, there are a couple of GNOME sessions, and the
   "Default" session, which will launch x-session-manager which might or
   might not gnome-session
 - sessions can be started via startx and/or various other ways


 Note: there's currently an upstream bug that gnome-session does not
 wait on DBus enough; see GNOME bug #395488.

--
Loïc Minier


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Alan Baghumian
Hi,

Does d-i install dbus service as a standard part of the system?

Alan

>         Hi,
>
>  The session DBus in Debian Xsessions is currently started by
>  /etc/X11/Xsession.d/75dbus_dbus-launch if the use-session-dbus option
>  is set.
>
>  Newer gnome-session will spawn a session DBus automatically if none has
>  been started.
>
>  If gnome-session launches DBus, DBus will inherit env from
>  gnome-session which is handy for gnome-keyring for example.
>
>  I suspect we wouldn't suffer from the sound issues (the desktop sounds
>  are not working bugs) would we be moving to launch DBus from
>  gnome-session, and I think this is what we should aim to do.
>
>
>  I personally think it makes a lot of sense to launch DBus from
>  gnome-session; what I wonder about is how we're going to switch to this
>  setup.
>    Ubuntu plans to fix this via a patch to the dbus Xsession snippet to
>  avoid starting DBus when running GNOME session; see Ubuntu #62163 and
>  <http://librarian.launchpad.net/7170382/dbus_1.0.2-1ubuntu34.patch>.
>    It's not trivial to know whether we're really in a GNOME session
>  because:
>  - from the PoV of gdm, there are a couple of GNOME sessions, and the
>    "Default" session, which will launch x-session-manager which might or
>    might not gnome-session
>  - sessions can be started via startx and/or various other ways
>
>
>  Note: there's currently an upstream bug that gnome-session does not
>  wait on DBus enough; see GNOME bug #395488.
>
> --
> Lo�c Minier
>
>
> --
> To UNSUBSCRIBE, email to [hidden email]
> with a subject of "unsubscribe". Trouble? Contact
> [hidden email]
>
>



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Alan Baghumian
Oh GOD,

As I understand, if we prevent /etc/X11/Xsession.d/75dbus_dbus-launch to
be executed, gnome-session will start dbus and it's what we need exactly.
But that #395488 bug complicates the situation... the risk of killing
dbus-daemon at all...

Alan

> Hi,
>
> Does d-i install dbus service as a standard part of the system?
>
> Alan
>
>>         Hi,
>>
>>  The session DBus in Debian Xsessions is currently started by
>>  /etc/X11/Xsession.d/75dbus_dbus-launch if the use-session-dbus option
>>  is set.
>>
>>  Newer gnome-session will spawn a session DBus automatically if none has
>>  been started.
>>
>>  If gnome-session launches DBus, DBus will inherit env from
>>  gnome-session which is handy for gnome-keyring for example.
>>
>>  I suspect we wouldn't suffer from the sound issues (the desktop sounds
>>  are not working bugs) would we be moving to launch DBus from
>>  gnome-session, and I think this is what we should aim to do.
>>
>>
>>  I personally think it makes a lot of sense to launch DBus from
>>  gnome-session; what I wonder about is how we're going to switch to this
>>  setup.
>>    Ubuntu plans to fix this via a patch to the dbus Xsession snippet to
>>  avoid starting DBus when running GNOME session; see Ubuntu #62163 and
>>  <http://librarian.launchpad.net/7170382/dbus_1.0.2-1ubuntu34.patch>.
>>    It's not trivial to know whether we're really in a GNOME session
>>  because:
>>  - from the PoV of gdm, there are a couple of GNOME sessions, and the
>>    "Default" session, which will launch x-session-manager which might or
>>    might not gnome-session
>>  - sessions can be started via startx and/or various other ways
>>
>>
>>  Note: there's currently an upstream bug that gnome-session does not
>>  wait on DBus enough; see GNOME bug #395488.
>>
>> --
>> Lo�c Minier
>>
>>
>> --
>> To UNSUBSCRIBE, email to [hidden email]
>> with a subject of "unsubscribe". Trouble? Contact
>> [hidden email]
>>
>>
>
>
>
> --
> To UNSUBSCRIBE, email to [hidden email]
> with a subject of "unsubscribe". Trouble? Contact
> [hidden email]
>
>



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Josselin Mouette
In reply to this post by Loïc Minier
Le dimanche 06 mai 2007 à 13:06 +0200, Loïc Minier a écrit :
>  - from the PoV of gdm, there are a couple of GNOME sessions, and the
>    "Default" session, which will launch x-session-manager which might or
>    might not gnome-session

See the gnomerc snippet which already does this detection:

BASESTARTUP=`basename "$STARTUP" | cut -d\  -f1`
if [ "$BASESTARTUP" = gnome-session -o \
        \( "$BASESTARTUP" = x-session-manager -a \
        "`readlink /etc/alternatives/x-session-manager`" = \
                /usr/bin/gnome-session \) ]; then
   blabla
fi

>  - sessions can be started via startx and/or various other ways

AFAIK startx also uses Xsession.

--
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Tim Dijkstra
In reply to this post by Loïc Minier
On Sun, 6 May 2007 13:06:20 +0200
Loïc Minier <[hidden email]> wrote:

>  I personally think it makes a lot of sense to launch DBus from
>  gnome-session;

For me it doesn't make sense. DBus aims to be more generic than just
for gnome. You didn't make really clear why it should be started from
gnome-session instead of during the X start-up. If you try to sneak in
extra information into DBus' environment, that could be annoying for
people who use an occasional gnome program, but do not use
gnome-session.

grts Tim

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Loïc Minier
In reply to this post by Josselin Mouette
On Sun, May 06, 2007, Josselin Mouette wrote:

> >  - from the PoV of gdm, there are a couple of GNOME sessions, and the
> >    "Default" session, which will launch x-session-manager which might or
> >    might not gnome-session
>
> See the gnomerc snippet which already does this detection:
>
> BASESTARTUP=`basename "$STARTUP" | cut -d\  -f1`
> if [ "$BASESTARTUP" = gnome-session -o \
>         \( "$BASESTARTUP" = x-session-manager -a \
>         "`readlink /etc/alternatives/x-session-manager`" = \
>                 /usr/bin/gnome-session \) ]; then
>    blabla
> fi

 Yes, I know, this is exactly what the patch I pointed at does ... and
 it's very fragile.  It would also be quite ugly to encode GNOME
 awareness in dbus stuff.

 I think there might be better ways to be more robust, cleaner, while
 still offering more control to the end-user/end-administrator.  For
 example:
 1) we could force all GDM sessions to be based on a .desktop file, pass
    this .desktop file to the whole session via an env var or another
    convention (~/.gdm-session-$DISPLAY.desktop could be a symlink to
    this desktop file); options would be encoded in X- fields of this
    file
 2) we could pass various information directly via environment, such as
    X_SESSION_OPTIONS="nodbus" and X_SESSION_TYPE="gnome" and use this as
    a base to decide to parse .gnomerc and to disable dbus (a Xsession.d
    script would add "nodbus" to X_SESSION_OPTIONS if X_SESSION_TYPE is
    gnome)

 I think both of the above options could be more robust than the current
 check for the value of "STARTUP", while still giving end-user control
 over what the session should or should not do.

> >  - sessions can be started via startx and/or various other ways
>
> AFAIK startx also uses Xsession.

 Yes, startx does, but by various other ways I meant:
 - .xsession or .Xsession (Xsession.d/* are still read, but STARTUP wont
   match this)
 - overrides files of various dms, or session .desktop files
 - custom manual calls to /etc/X11/Xsession

--
Loïc Minier


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Loïc Minier
In reply to this post by Tim Dijkstra
On Sun, May 06, 2007, Tim Dijkstra wrote:
> For me it doesn't make sense. DBus aims to be more generic than just
> for gnome. You didn't make really clear why it should be started from
> gnome-session instead of during the X start-up. If you try to sneak in
> extra information into DBus' environment, that could be annoying for
> people who use an occasional gnome program, but do not use
> gnome-session.

 gnome-session is the canonical way to properly start a GNOME session,
 with a working GNOME stack.  If a normal GNOME session needs dbus, then
 I find it quite normal that gnome-session spawns it instead of relying
 on the distributor to integrate dbus in the startup before
 gnome-session.
   In fact, you can go even farther and say that each individual
 application needing the session dbus should arrange for it being
 present, which is the case with recent DBus: but this is already solved
 by newer DBus which will spawn a session dbus if any app needs to
 access it.

 Yes, starting dbus from gnome-session is a broken design, but it will
 work in more cases than the current way of starting it, and it will
 more consistent across distributions; I think we would benefit from
 switching to this startup style.

--
Loïc Minier


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Starting DBus from gnome-session instead of Xsession

Sjoerd Simons-2
On Mon, May 07, 2007 at 10:41:54AM +0200, Loïc Minier wrote:
>  Yes, starting dbus from gnome-session is a broken design, but it will
>  work in more cases than the current way of starting it, and it will
>  more consistent across distributions; I think we would benefit from
>  switching to this startup style.

Your obviously correct in this, we should care about our users :). But before
switching to this style i'd like to take some time to find out what exactly
breaks when gnome-session _doesn't_ start dbus. So we can raise our concerns
nicely with upstream and tell them what to fix :)

The upstream bug reports the gnome-keyring socket env var as one
of the reasons, but currently gnome-keyring supports socket discovering magic
though dbus.. So that should be fine.

The other thing is that the SESSION_MANAGER env var isn't set. And there seems
to be an issue with system sounds through esd (although it's unclear if it's
related).

  Sjoerd
--
I THINK THEY SHOULD CONTINUE the policy of not giving a Nobel Prize for
paneling.
                -- Jack Handley, The New Mexican, 1988.


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]