Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201625 - x11-apps/xinit-1.0.5-r1, gnome-base/gnome-session-2.20.1: Session start scripts reference old file /etc/X11/XF86Config instead of newer xorg.conf - fails XkbSymbols
Summary: x11-apps/xinit-1.0.5-r1, gnome-base/gnome-session-2.20.1: Session start scrip...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 201535
  Show dependency tree
 
Reported: 2007-12-07 23:23 UTC by Robin Johnson
Modified: 2009-11-05 20:05 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-07 23:23:22 UTC
This affects both x11-apps/xinit-1.0.5-r1 and gnome-base/gnome-session-2.20, as the GNOME file is directly derived from the Xsession one.

x11: Xsession should maybe also have code reading the /etc/X11/xinit/xinitrc.d/ directory, see the Gnome and KDE sessions for an example - DBus --session is started from that location.

The bad block of code:
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
       xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
       if [ -n "$xkbsymbols" ]; then
           setxkbmap -symbols "$xkbsymbols"
           XKB_IN_USE=yes
       fi
    fi
fi
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-08 04:22:52 UTC
dberkholz: see comments 8 and 9 in bug 201535. The status of the various Xsession files is a mess, having being forked inside Gentoo multiple times - they could really use factoring out some common code.

crypto(alonbl): previous we had discussions about gpg-agent and ssh-agent being started by the X session if it was not already started. I see that the Gnome Xsession file does do this for ssh-agent, but not gpg-agent. Should we make the sessions start both, either or neither? (eg make the users start it in their own profiles, but that might have issues under [gkx]dm).
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-08 07:27:18 UTC
I don't think that automatic execution of unrelated programs is correct... When you install gnome you don't expect it to run other products. The correct way is  adding new packages (xsession-ssh, xsession-gnupg) or USE flags for gnupg/ssh in order to do this.

Also, if I remember correctly seahorse replaces gpg-agent, and one of its options is to be executed using dbus. I don't think gnome people like gpg-agent...

I am glad that kde did not add these tricks :)
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-08 07:49:35 UTC
alonbl: KDE ships /usr/kde/3.5/env/agent-startup.sh, which does worse than the Gnome startup - it doesn't even check for pre-existing env vars before starting the agents. I'm not a KDE user myself, so I don't know if the file is uncommented manually or by something in the KDE configuration system.

However KDE already looks at /etc/X11/xinit/xinitrc.d/, so if users add stuff in there that starts the various agents, we should be able to drop them from the main scripts easily (also gets us consistency been WM environments) - The seahorse agent startup would belong there as well.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-08 07:52:20 UTC
kde: added you to the CC because of /etc/X11/Sessions/kde-3.5 and /usr/kde/3.5/bin/startkde and /usr/kde/3.5/env/agent-startup.sh.
Please chime in with any opinions on sharing more stuff between the /etc/X11/Sessions/ scripts.
Comment 5 Carsten Lohrke (RETIRED) gentoo-dev 2007-12-08 15:43:35 UTC
(In reply to comment #2)
> I don't think that automatic execution of unrelated programs is correct... 

I do agree on that point. The KDE startup script leaves it to the user, too.


(In reply to comment #3)
> alonbl: KDE ships /usr/kde/3.5/env/agent-startup.sh, which does worse than the
> Gnome startup - it doesn't even check for pre-existing env vars before starting
> the agents. I'm not a KDE user myself, so I don't know if the file is
> uncommented manually or by something in the KDE configuration system.

The user has to uncomment it manually. Checking the environment wouldn't be bad, but imply patching and therefore a bit more maintenance overhead.



Wrt. sharing "stuff" - there is /etc/X11/xinit/xinitrc.d/ for common startup scripts. The startkde script is naturally very KDE specific and I guess the same is true for Gnome and others. What is most important, when it comes to these scripts, is to keep them as lean as possible; users will complain about slow desktop startup.


The kdm config scripts are in /usr/kde/3.5/share/config/kdm/ btw..
Comment 6 Jim Ramsay (lack) (RETIRED) gentoo-dev 2007-12-10 13:10:39 UTC
What about using the freedesktop autostart idea[1] for all of this, as it seems to be a reasonable way of adding apps that should be started at desktop login.  Users can even control which ones they want on or off, or add their own custom startups.

I'm not sure if or how Gnome and KDE support this spec, so that may need some figuring.  But it makes sense to me that gpg-session, ssh-agent, dbus-session, The XKB/Xmodmap magic, and everything else could be started in this way.

I have recently added the rox-base/rox-autostart package, which is a fairly simple GUI a user may use for enabling/disabling these autostart items.

[1] http://standards.freedesktop.org/autostart-spec/
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-12-10 13:32:11 UTC
(In reply to comment #6)
> What about using the freedesktop autostart idea[1] for all of this, as it seems[... snip]

Gnome has been supporting this for some time (empathy, g-v-m, g-p-m, beagle and such are started this way). The problem is how to properly chain program startups in a way that all different programs have the appropriate environment.

For example, chaining seahorse-agent with ssh-agent in gnome-session so that it is available for the rest of the desktop needs to be done in /etc/X11/xinit/xinitrc.d/ (as of 2.20) or evolution (for example) won't be able to use seahorse to ask for the gpg key.

Afaik, this is not achievable through the freedesktop spec.
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2007-12-10 21:03:46 UTC
That sounds like a useful direction, but I think that's upstream's call rather than ours. I did a couple of quick Google searches for kdm and gdm and it wasn't obvious that either of them support it yet, although it looks like the plan was that kde4 should.
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2007-12-10 21:06:03 UTC
Ah, didn't read eva's comment first. Seems like we kinda need dependencies in these scripts, same as init scripts. eva, what exactly is the problem with getting the appropriate environments? Is it just starting things in the right order?
Comment 10 Jim Ramsay (lack) (RETIRED) gentoo-dev 2007-12-10 21:23:33 UTC
I put in a quick request on the XDG mailing list a freedesktop, and was basically told:

There should be no need to support startup order in the autostart system.  Any agents like ssh, seahorse, etc, which need to set environment variables should be started by the X session.  Anything else should be rewritten so that they deal properly with being started up in an odd order (such as waiting for dbus registrations, etc).

So please disregard my suggestion of using autostart for all of this - Apparently that is not (nor will it ever be) the intended use of autostart.
Comment 11 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-05-08 14:17:12 UTC
(In reply to comment #9)
> Ah, didn't read eva's comment first. Seems like we kinda need dependencies in
> these scripts, same as init scripts. eva, what exactly is the problem with
> getting the appropriate environments? Is it just starting things in the right
> order?
> 

ouch I thought I replied to this but apparently not. I'm not sure you need a special order for programs fulfilling different goals but at least all programs started by X need to be up and running before the desktop programs start for them to be able to access the env variables/sockets and whatnot X session started programs set up.

Currently, the method adopted in gentoo, ubuntu and probably all distros out there is to build up a string that contains each agent. It is evaled and the execution goes as follows:

First program executes and fork passing the rest of the string to the next program until it is empty.

I hope it's clear :)
Comment 12 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-04-11 01:35:12 UTC
Anything we can (should?) do about this?
Comment 13 Rémi Cardona (RETIRED) gentoo-dev 2009-06-19 16:02:08 UTC
As far as the original bug is concerned, this block of code is never called into because we've never shipped Xsun.

As for unifying Xsession scripts across various DMs and DEs, this is probably work that should be done as part of FreeDesktop with upstream GDM/KDM/... folks involved.

Having unified but Gentoo-only X scripts is a can of worm I definitely don't want to open. If anyone wants to tackle this, I'm definitely willing to help out where I can. But if no-one wants to, this is very low on my TODO list.

Thanks
Comment 14 Rémi Cardona (RETIRED) gentoo-dev 2009-11-04 10:51:02 UTC
IMO, this is pretty much fixed. xinitrc.d is now the central place for all this stuff.

We just need to fix xinit to really use it (right now it's not doing the right thing, gdm is doing it right).

@x11, anyone up for this?

Thanks
Comment 15 Rémi Cardona (RETIRED) gentoo-dev 2009-11-05 20:05:54 UTC
Fixed in the overlay, please try it to make sure I haven't screwed up too much.

Thanks