Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334111 - x11-misc/slim needs better session handling
Summary: x11-misc/slim needs better session handling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Jeremy Olexa (darkside) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-23 18:00 UTC by Ian Stakenvicius (RETIRED)
Modified: 2011-08-16 02:16 UTC (History)
1 user (show)

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


Attachments
Xsession script for slim to use in its login_cmd (Xsession,1.79 KB, text/plain)
2010-08-23 18:04 UTC, Ian Stakenvicius (RETIRED)
Details
New slim-1.3.2-config.diff (slim-1.3.2-config.diff,2.06 KB, text/plain)
2010-08-23 18:09 UTC, Ian Stakenvicius (RETIRED)
Details
Patched ebuild for slim-1.3.2 (slim-1.3.2.ebuild.patch,421 bytes, patch)
2010-08-23 18:15 UTC, Ian Stakenvicius (RETIRED)
Details | Diff
Xsession chooser script for slim to use in its login_cmd (Xsession,3.70 KB, text/plain)
2010-08-24 20:35 UTC, Ian Stakenvicius (RETIRED)
Details
New slim-1.3.2-config.diff (slim-1.3.2-config.diff,2.25 KB, text/plain)
2010-08-25 16:05 UTC, Ian Stakenvicius (RETIRED)
Details
Patched ebuild for slim-1.3.2 (slim-1.3.2-r1.ebuild.patch,1.11 KB, text/plain)
2010-08-25 16:27 UTC, Ian Stakenvicius (RETIRED)
Details
Xsession chooser script for slim to use in its login_cmd (Xsession,4.02 KB, text/plain)
2010-08-25 16:40 UTC, Ian Stakenvicius (RETIRED)
Details
Xsession chooser script for slim (Xsession,3.75 KB, text/plain)
2010-10-02 23:05 UTC, Vikraman (RETIRED)
Details
Xsession chooser script for slim (Xsession,3.75 KB, text/plain)
2010-10-04 20:18 UTC, Vikraman (RETIRED)
Details
Xsession chooser script for slim (Xsession,3.76 KB, text/plain)
2010-10-04 22:14 UTC, Vikraman (RETIRED)
Details
Xsession chooser script for slim (new.slim.xsession,3.95 KB, text/plain)
2011-07-28 17:15 UTC, Ian Stakenvicius (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-23 18:00:11 UTC
This is in corollary to bug 313127.

Slim, by default, doesn't have any proper session handling because it is configured to launch the session/wm using /etc/X11/xinit/xinitrc ; and recent versions of xinit do not include an xinitrc which reads ~/.xinitrc or ~/.xsession.  This results in slim only launching the system-wide $XSESSION (if specified) or 'twm'.

As such, the only recourse for users to obtain user-specific sessions is to change slim.conf to use ~/.xinitrc (and make sure every user has one), or to hack /etc/X11/xinit/xinitrc back to the way it was.

After talking with remi in #gentoo-desktop, it was decided the best solution for this would be to add slim-specific version of xinitrc to slim, so that it would handle session selection properly.  I've built such a script and will be submitting it as well as patches to the config and the ebuild for slim-1.3.2 (although this would apply equally to slim-1.3.1 and previous).
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-23 18:04:44 UTC
Created attachment 244237 [details]
Xsession script for slim to use in its login_cmd

This is the session chooser script.  It's heavily based on the xinitrc script from current-stable xinit.  The script sources ~/.xprofile if exists, and will use either ~/.xsession or the user-specified session (selected by [F1]).  /etc/X11/chooser.sh is used to determine the actual session command to use.  If chooser.sh fails to find a command, then ~/.xinitrc (if exists) or system xinitrc is called as a failsafe.

This file, although a bash script, is not something I would intend to be executable.  See the next attachment for the patch to slim.conf , which contains my suggested login_cmd setting
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-23 18:09:01 UTC
Created attachment 244249 [details]
New slim-1.3.2-config.diff

This file is an updated slim-1.3.2-config.diff , with the only change being the login_cmd line.
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-23 18:15:50 UTC
Created attachment 244251 [details, diff]
Patched ebuild for slim-1.3.2

This patch is a rough effort to install the Xsession script form $FILESDIR to /usr/share/slim/
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-24 20:35:59 UTC
Created attachment 244453 [details]
Xsession chooser script for slim to use in its login_cmd

Here's an updated script -- it no longer depends on xinit, and leaves all (or as much as possible) of its actual session configuration to the scripts in /etc/X11/Sessions/ (since each of those do everything there anyhow)
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-25 16:05:35 UTC
Created attachment 244575 [details]
New slim-1.3.2-config.diff

Updated the config.diff to read sessions using the (undocumented) sessiondir config option.  

This way slim will have the current list of sessions available on the system and not depend on the user to keep slim.conf up to date.
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-25 16:27:00 UTC
Created attachment 244581 [details]
Patched ebuild for slim-1.3.2

Updated the patch to the most recent slim-1.3.2 ebuild, to include Xsession script installation as well as an updated pkg_postinst() message to reflect the new config.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-25 16:40:46 UTC
Created attachment 244583 [details]
Xsession chooser script for slim to use in its login_cmd

Last change -- added back the default session handler if no user session is specified, so that previous default functionality is preserved.
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-09-20 15:22:31 UTC
+*slim-1.3.2-r2 (20 Sep 2010)
+
+  20 Sep 2010; Jeremy Olexa <darkside@gentoo.org>
+  -slim-1.3.1_p20091114.ebuild, -files/slim-1.3.1-config.diff,
+  -files/slim-1.3.1-gcc4.4.patch, -slim-1.3.2.ebuild, +slim-1.3.2-r2.ebuild,
+  -files/slim-1.3.2-config.diff, +files/slim-1.3.2-r2-config.diff,
+  +files/Xsession:
+  Revbump to vastly improve the session handling. Work done by Ian
+  Stakenvicius in bug 334111. Also remove old and cleanup.

Thanks again!
Comment 9 No Name 2010-09-23 14:35:10 UTC
Please add support for the XSESSION variable in the /etc/rc.conf for the *realy* first try... Like other displaymanager also like xdm...

So that you on a one person pc only edit this variable to set your favorite wm...

Thanks!
Comment 10 No Name 2010-09-26 12:40:40 UTC
Any Idea?
Comment 11 Ian Stakenvicius (RETIRED) gentoo-dev 2010-09-27 12:48:19 UTC
It does this now.  Specifically, the following events occur:

1 - it loads Xprofile and ~/.xprofile if they exist (i believe XSESSION could be set here also, btw)

2 - it checks the argument passed to the script via slim, if any -- it also overloads a few possibilities to the /etc/X11/Sessions/Xsession script (which is the one that XDM calls by default)

3 - it calls /etc/X11/chooser.sh, which finds an appropriate script based on the value of the XSESSION environment variable (as set in /etc/env.d/90Xsession - see the Xorg guide for more info)

I tested all of these possibilities on my system.  If they are not working for you then I can try and help if you can send more debug info:
A: /etc/env.d/90xsession or whatever other file you're setting your XSESSION variable
B: ~/.xsession
C: directory listing of /etc/X11/Sessions/

Comment 12 Vikraman (RETIRED) gentoo-dev 2010-10-02 23:05:46 UTC
Created attachment 249376 [details]
Xsession chooser script for slim

I have improved the Xsession script, rewriting it using help from gdm's Xsession and Xorg's xinitrc. I have fixed the calls to xinitrc.d scripts and also cleaned up the script a lot. It works great with consolekit and policykit now.
Comment 13 Vikraman (RETIRED) gentoo-dev 2010-10-04 20:18:20 UTC
Created attachment 249588 [details]
Xsession chooser script for slim

Fixed a slight mistake in an if block
Comment 14 Vikraman (RETIRED) gentoo-dev 2010-10-04 22:14:22 UTC
Created attachment 249598 [details]
Xsession chooser script for slim

Fixed now, please ignore last attachment
Comment 15 Ian Stakenvicius (RETIRED) gentoo-dev 2011-07-28 17:15:32 UTC
Created attachment 281315 [details]
Xsession chooser script for slim


This script is much improved, thanks!  The only thing that might be of issue is that, since this is primarily a chooser for /etc/X11/Sessions/* scripts, most of the Xmodmap stuff, etc should only be executed if we are starting the failsafe xterm session or a custom command, instead of all the time.  It can safely be assumed that session startups handle this and we shouldn't do them twice.

I've attached a slightly modified version.  Note that integrating this version (either yours or mine) would close bug 370089 (fixed) and bug 374065 (invalid)
Comment 16 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-08-16 02:16:23 UTC
(In reply to comment #15)
> Created attachment 281315 [details]
> Xsession chooser script for slim
> 
> 
> This script is much improved, thanks!  The only thing that might be of issue is
> that, since this is primarily a chooser for /etc/X11/Sessions/* scripts, most
> of the Xmodmap stuff, etc should only be executed if we are starting the
> failsafe xterm session or a custom command, instead of all the time.  It can
> safely be assumed that session startups handle this and we shouldn't do them
> twice.
> 
> I've attached a slightly modified version.  Note that integrating this version
> (either yours or mine) would close bug 370089 (fixed) and bug 374065 (invalid)

done.