Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301051 - x11-apps/xinit: /etc/X11/Sessions/Xsession ignores session passed by login managers
Summary: x11-apps/xinit: /etc/X11/Sessions/Xsession ignores session passed by login ma...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 04:30 UTC by William Keaney
Modified: 2019-05-15 18:12 UTC (History)
2 users (show)

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


Attachments
Xsession from KDM (Xsession,1.99 KB, text/plain)
2010-01-15 04:31 UTC, William Keaney
Details
Patched gentoo's Xsession (Xsession,2.21 KB, text/plain)
2010-01-21 16:02 UTC, P Purkayastha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Keaney 2010-01-15 04:30:19 UTC
The /etc/X11/Sessions/Xsession distributed with x11-apps/xinit completely ignores any session passed to it other than 'failsafe':

case $# in
1)
        case $1 in
        failsafe)
                exec xterm -geometry 80x24-0-0
                ;;
        esac
esac

This results in failure to start a session selected by a login manager, and instead considers only entries in $HOME/.Xclients and /etc/X11/xinit/Xclients (which doesn't exist).

Reproducible: Always
Comment 1 William Keaney 2010-01-15 04:31:30 UTC
Created attachment 216569 [details]
Xsession from KDM

I am attaching the Xsession file used by KDM, which correctly checks for the session passed by the login manager.
Comment 2 William Keaney 2010-01-15 04:35:06 UTC
I should note that I am running x11-apps/xinit-1.0.8-r10
Comment 3 P Purkayastha 2010-01-21 16:02:15 UTC
Created attachment 217090 [details]
Patched gentoo's Xsession

Alternatively, one can patch gentoo's Xsession file to handle sessions in /usr/share/xsessions. The file is attached. Following are the changes I made:

/etc/X11> diff -u Sessions/Xsession Xsession 
--- Sessions/Xsession	2009-12-24 15:23:37.000000000 -0500
+++ Xsession	2010-01-15 10:16:32.766354105 -0500
@@ -7,6 +7,7 @@
 	failsafe)
 		exec xterm -geometry 80x24-0-0
 		;;
+    *)  session="$1";;
 	esac
 esac
 
@@ -94,7 +95,9 @@
 
 unset XKB_IN_USE
 
-if [ -x "$startup" ]; then
+if [ -f "$session" ]; then
+    eval exec "$session"
+elif [ -x "$startup" ]; then
 	exec "$startup"
 elif [ -x "$HOME/.Xclients" ]; then
 	exec "$HOME/.Xclients"
Comment 4 Doktor Notor 2010-03-22 00:18:19 UTC
(In reply to comment #3)
> Alternatively, one can patch gentoo's Xsession file to handle sessions in
> /usr/share/xsessions.

Probably missing something here, but I don't see how this 

if [ -f "$session" ]; then
    eval exec "$session"

handles stuff in /usr/share/xsessions; the only thing it produces here it trying to exec $session as a command directly (which naturally fails)
Comment 5 P Purkayastha 2011-05-01 17:41:50 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Alternatively, one can patch gentoo's Xsession file to handle sessions in
> > /usr/share/xsessions.
> 
> Probably missing something here, but I don't see how this 
> 
> if [ -f "$session" ]; then
>     eval exec "$session"
> 
> handles stuff in /usr/share/xsessions; the only thing it produces here it
> trying to exec $session as a command directly (which naturally fails)

It seems I was not in the CC list and never got any notification.

This line is taken directly from the kdmrc file. It used to work earlier and going by the kdmrc file (see the one attached in this bug report) kdm itself runs something like that. I am not sure if it still works since I am using slim nowadays (and the configuration for that is different).
Comment 6 Matt Turner gentoo-dev 2019-03-03 23:17:10 UTC
Suggestions welcome (patches).
Comment 7 Matt Turner gentoo-dev 2019-05-15 18:12:30 UTC
This bug is pretty ancient at this point, and I'm not sure I understand it.

If someone is still interested, please reopen.