Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25273 - /etc/X11/Sessions/Gnome script can not run ~/.xinitrc
Summary: /etc/X11/Sessions/Gnome script can not run ~/.xinitrc
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-25 13:01 UTC by Daqing Li
Modified: 2007-07-28 15:39 UTC (History)
4 users (show)

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


Attachments
xinitrc-common (xinitrc-common,2.11 KB, text/plain)
2005-09-08 10:24 UTC, Donnie Berkholz (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daqing Li 2003-07-25 13:01:29 UTC
/etc/X11/Sessions/Gnome has a bug in following results it cannot run 
~/.xinitrc.

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" ]; then
            . "$i"
        fi
    done
fi

The bug is caused by the fact that there is no directory named xinitrc.d under
/etc/X11/xinit/ except a script file named xinitrc. In /etc/X11/xinit/xinitrc,
~/.xinitrc is checked and executed if exits. Becaused of this bug, ~/.xinitrc
will not be checked and executed. So either make a directory named xinitrc.d
under /etc/X11/xinit/ and put /etc/X11/xinit/xinitrc under
/etc/X11/xinit/xinitrc.d/ or just modify the above code in 
/etc/X11/Sessions/Gnome as below will check and execute ~/.xinitrc.

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" ]; then
            . "$i"
        fi
    done
# check ~/.xinitrc
elif [ -f $HOME/.xinitrc ]; then
    exec /bin/sh "$HOME/.xinitrc"
fi
Comment 1 Brad Laue (RETIRED) gentoo-dev 2003-08-13 06:38:17 UTC
On another note, the Gnome script in /etc/X11/Sessions doesn't properly set up its environment before starting the desktop. This became apparent to me when launching a KDE program from within GNOME, and noticing that none of the kde-env environment variables were present in my GNOME session.
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2003-09-17 10:15:31 UTC
i'm tempted to mark this invalid/wontfix because :

1. If you choose a Gnome session in GDM, then you should be using ~/.gnomerc instead of ~/.xinitrc

2. If you don't want to launch gnome-session, then you should choose "xsession" as your session in GDM and use ~/.xsession instead.

3. I've always thought that ~/.xinitrc was only for when X is started from the console using "startx".

Brad,

I don't understand why KDE environment variables should be in the Gnome init script. Shouldn't you be putting those varibles in your .bash_profile or such? Or am I missing the point?
Comment 3 Alexander Papaspyrou 2004-10-11 04:17:00 UTC
Yes, you are. One of the greater nuisances caused by this code is that people have to maintain two system-wide Xmodmap (and possibly other config) files:

"/etc/X11/Sessions/Gnome" assumes "/etc/X11/Xmodmap" for system-wide configuration, where "/etc/X11/xinit/xinitrc" searches for "/etc/X11/xinit/.Xmodmap".

At least we should setup a symlink from one file to the other to ensure only one configuration file; OTOH it would be a much cleaner solution to unify xinit-related stuff (such as xmodmap, xrdb and the like) in *one* place rather than enforcing painful config clutter (as, in fact, being the current situation).

So there three options:
1. Symlink /etc/X11/Xmodmap to /etc/X11/xinit/.Xmodmap. This seems to be the easiest one, but it's neither portable nor safe to future changes. Furthermore, vanilla X11 installations don't have this file; we then have to create it during emerge or live with a dead symlink until the user creates the link target.

2. Change "/etc/X11/Sessions/Gnome" (and wherever else necessary) to look in "/etc/X11/xinit" directly instead of "/etc/X11/xinit/xinitrc.d". This is nice and clean, but we lose the possibilities of the additional level of indirection. OTOH I'm not sure if it is used at all.

3. Create "/etc/X11/xinit/xinitrc.d/", symlink "/etc/X11/xinit/xinitrc.d/default" to "/etc/X11/xinit/xinitrc" and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary). This seems to be the cleanest solution, as it respects the "traditional way" to setup system-wide xinit-related stuff via "/etc/X11/xinit/xinitrc" and separates X-related configuration from DM-related configuration.

IMHO, we should choose between 2. and 3., depending on whether the additional level of "indirection" through "xinitrc.d" is needed or not.

Opinions, anyone?
Comment 4 Alexander Papaspyrou 2004-10-11 04:21:19 UTC
Oops, I made a slight mistake in my previous comment. It should read:

[...]
2. Change "/etc/X11/Sessions/Gnome" (and wherever else necessary) to look in "/etc/X11/xinit" directly instead of "/etc/X11/xinit/xinitrc.d" _and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary)_. This is nice and clean, as it separates xinit-stuff from DM-stuff; we still give up the possibilities of the additional level of indirection. OTOH I'm not sure if it is used at all.

3. Create "/etc/X11/xinit/xinitrc.d/", symlink "/etc/X11/xinit/xinitrc.d/default" to "/etc/X11/xinit/xinitrc" and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary). This seems to be the cleanest solution, as it respects the "traditional way" to setup system-wide xinit-related stuff via "/etc/X11/xinit/xinitrc" and separates X-related configuration from DM-related configuration.

Sorry for the mistake.
Comment 5 Leonardo Boshell (RETIRED) gentoo-dev 2005-05-28 04:07:16 UTC
So basically this comes down to a conflict caused by the following situation:

/etc/X11/Sessions/Gnome has these lines:
#----
sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap
#----

while /etc/X11/xinit/xinitrc has:
#----
xinitdir=/usr/X11R6/lib/X11/xinit
sysresources=$xinitdir/.Xresources
sysmodmap=$xinitdir/.Xmodmap
#----

x11 guys: Do you have any suggestions? Should we modify our Gnome session script?

Also worth checking out bug #89624 while we're at it.
Comment 6 Joshua Baergen (RETIRED) gentoo-dev 2005-05-31 20:05:00 UTC
I like #3 personally.  It would appear that this would align well with what some
other distributions (IE, Fedora and thus I'm sure many others) are doing.
Comment 7 Mike Gardiner (RETIRED) gentoo-dev 2005-09-08 09:19:27 UTC
I like 3 as well, Donnie?
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2005-09-08 10:24:22 UTC
Created attachment 67948 [details]
xinitrc-common

I think 3 is along the right track, and now that upstream is (almost) modular,
I think we could get some code together (perhaps from redhat) and send a patch
up.

Also in modular, Josh, could you change xinitdir=/usr/X11R6/lib/X11/xinit to
xinitdir=/etc/X11 and see what happens? That will at least fix up comment #5.

For reference, I've attached the main part of fedora's xinitrc-common file,
which is "common code shared between the Xsession and xinitrc scripts which has
been factored out to avoid duplication."
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2005-09-08 10:34:40 UTC
I just uploaded
http://dev.gentoo.org/~spyderous/xorg-x11/redhat/xinitrc-4.0.19-1/, which is the
latest development Fedora release, for anyone who's interested in perusing it.
Comment 10 Joshua Baergen (RETIRED) gentoo-dev 2005-09-08 16:23:19 UTC
(In reply to comment #8)
> Also in modular, Josh, could you change xinitdir=/usr/X11R6/lib/X11/xinit to
> xinitdir=/etc/X11 and see what happens? That will at least fix up comment #5.

This has been committed to modular.
Comment 11 Gilles Dartiguelongue (RETIRED) gentoo-dev 2006-06-13 19:17:45 UTC
you I love old bugs :)

So what is the status of this ?

I see that the "/etc/X11/xinit/xinitrc.d/" directory exists but there is just a script for dbus in it.
Comment 12 Xake 2007-07-28 14:08:34 UTC
Closing time?;)
Comment 13 Rémi Cardona (RETIRED) gentoo-dev 2007-07-28 15:39:55 UTC
Yeah :)

To all, feel free to reopen if it's still an issue.