Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500224 - x11-misc/slim-1.3.6-r3 - config file should show default_session parameter
Summary: x11-misc/slim-1.3.6-r3 - config file should show default_session parameter
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Ian Stakenvicius (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-03 23:38 UTC by fcrvincent
Modified: 2014-02-12 14:52 UTC (History)
1 user (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 fcrvincent 2014-02-03 23:38:00 UTC
Apparently x11-misc/slim-1.3.6-r3 has been patched to support the useful default_session parameter but the parameter is not documented in the /etc/slim.conf configuration file

Reproducible: Always



Expected Results:  
There should be a line or two explaining the default_session parameter in /etc/slim.conf
Comment 1 fcrvincent 2014-02-04 12:11:24 UTC
My mistake appenrently Gentoo slim-1.3.6-r3 is just like regular slim-1.3.6 and has no support whatsoever for a default session
Comment 2 Barnaby 2014-02-04 12:38:39 UTC
There's no such configuration option listed in cfg.cpp in either gentoo's source or the upstream source. 

However, the source is patched in gentoo to allow a default session to be specifed and it is documented in the slim.conf file.

< # Set directory that contains the xsessions.
< # slim reads xsesion from this directory, and be able to select.
< sessiondir            /usr/share/xsessions/
---
> # Available sessions (first one is the default).
> # The current chosen session name is replaced in the login_cmd
> # above, so your login command can handle different sessions.
> # see the xinitrc.sample file shipped with slim sources
> sessions            xfce4,icewm-session,wmaker,blackbox
Comment 3 fcrvincent 2014-02-04 15:07:08 UTC
Thanks 

But whatever way I put it I cannot login to a default session unless I cycle through the available sessions at the Slim login screen.

The last config I tried was with:
In /etc/slim.conf: 
  login_cmd       exec /bin/bash -login ~/.xinitrc %session
  sessions        lxde
  sessiondir      /usr/share/xsessions

And with a basic ~/.xinitrc:
  #!/bin/sh
  exec /usr/bin/startlxde

No matter what it logins to Xsession (the first session listed with ls -U under /usr/share/xsessions) unless I cycle through the available sessions and explicitly select LXDE.
Comment 4 fcrvincent 2014-02-04 15:10:16 UTC
Going back to the buggy lxdm for now
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2014-02-04 15:36:03 UTC
Slim-1.3.6 works the same as Slim-1.3.5 did, except with the addition of being able to use sessions defined in *.desktop files instead of just the scripts in /etc/X11/Sessions.

That is, if you do not choose a session, then it will start the "default" session in accordance with your "XSESSION" environment variable, that is, it uses the script /etc/X11/Sessions/Xsession (which then determines what your default will be).  See the Gentoo Xorg guide for more info.

Hitting [F1] will allow you to choose a session from the list, however, having the actual default session show is neither easily feasible nor something that IMO is desirable by default, and so I do not intend to patch slim to do this.
Comment 6 fcrvincent 2014-02-04 17:06:24 UTC
I also think that it is not necessary/desirable to display the default session on the slim screen.

My problem with slim-3.6.1-r3 is that it no longer seems to read the XSESSION environment variable or any other slim.conf parameters (like sessions) in order to set a default session.  

The result is that unless I explicitly select the session with the F1 key, slim will not launch the default session wanted.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2014-02-04 17:07:51 UTC
odd.. works for me here.  I'll do a few more slim installs and test, to see if i can reproduce this.  To confirm, you've set XSESSION globally in /etc/env.d/[something] , or locally in .bashrc or .bash_profile ?
Comment 8 fcrvincent 2014-02-04 17:25:52 UTC
Thanks

Yes it is pretty weird - I unmerged/emerged slim several times and even deleted/reconfigured slim.conf to no avail. Never had a problem with the previous slim stable versions (have been using it for a couple of years and updating Gentoo roughly monthly). In my experience, with LXDE, kdm and gdm are overkill and lxdm is buggy (especially after a logout/relogin). Also I find that the Gentoo-customised slim version is simple and elegant. 

My XSESSION is set globally with XSESSION="lxde" in /etc/env.d/90xsession
Also echo $XSESSION returns the correct lxde value (as a user, as root the variable is empty).
Comment 9 fcrvincent 2014-02-04 21:49:40 UTC
Here is a workaround I found to make sure that only one session is always selected on a slim 1.3.6 login:

1. create a /usr/local/bin/slim directory
2. make a symbolic link in the directory to the wanted session e.g. 
  ln -s /usr/share/xsessions/LXDE.desktop LXDE.desktop
3. modify the /etc/slim.conf file with
  sessiondir=/usr/local/bin/slim

Now there is no need to select with F1 the default session on a slim login; login will always be made to the preferred session (LXDE in the example above).
Comment 10 fcrvincent 2014-02-05 09:42:50 UTC
Sorry the later workaround even does not work.

It works after the first couple of reboots but after that slim seems to ignore the custom sessiondir and come back to the default sessiondir and pickup whatever session is first in ls -U /usr/share/xsessions !
Comment 11 fcrvincent 2014-02-05 13:39:29 UTC
After further testing it happened that I could not login to the LXDE session even after selecting it via the F1 key. Instead I get a black screen with an X type cross cursor and no way to logout or even activate a tty session via ctr-alt-F1-6 

On such a failed slim login the /var/log/slim.log says: 

slim: waiting for X server to begin accepting connections.
slim: get_x11_device: cannot open display

May be the issue is not with the default session selection but with the interaction between slim and the X server.
Comment 12 Ian Stakenvicius (RETIRED) gentoo-dev 2014-02-05 14:49:31 UTC
(In reply to fcrvincent from comment #10)
> Sorry the later workaround even does not work.
> 
> It works after the first couple of reboots but after that slim seems to
> ignore the custom sessiondir and come back to the default sessiondir and
> pickup whatever session is first in ls -U /usr/share/xsessions !

Here's how things (are supposed to) work:

SLIM runs, gathers user credentials, etc.  It has an internal variable holding the selected session, which defaults to NULL (empty).

If you hit [F1], this variable is set to the top session on the stack from the "sessions" list or from the "sessiondir" contents.  Otherwise it stays NULL.

When your session is launched, by default, slim exec's "/usr/share/slim/Xsession %session" , where %session is the value of this variable -- it can be unset (ie, the "default" session), or it can be set to something specific, ie, /etc/X11/Sessions/[something] or the Exec= value from a .desktop file in /usr/share/xsessions/

As such, for a DEFAULT session start where no session is selected by [F1], it shouldn't matter what "sessions" or "sessiondir" are set to nor what their contents are, because that takes no effect.  The /usr/share/slim/Xsession script is what defines what happens when the script received no argument, which should be to execute or source /etc/X11/Sessions/Xsession , and therefore start whatever you have defined in your XSESSION environment variable.

Now, as for your latest post, it sounds like there are some other fishy things going on; i don't have enough information to know what that is at this time, nor can I provide advice on how to debug it right now.
Comment 13 fcrvincent 2014-02-05 15:02:52 UTC
Many thanks Ian for your feedback. 
Yes else something must be wrong with slim on my system. 
I will check if I can do more debugging and keep any progress posted here.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2014-02-05 19:34:08 UTC
(In reply to fcrvincent from comment #8)
> My XSESSION is set globally with XSESSION="lxde" in /etc/env.d/90xsession
> Also echo $XSESSION returns the correct lxde value (as a user, as root the
> variable is empty).

How can that be? env.d is not for normal users only, it's for every user, and here it works also as a root
Comment 15 fcrvincent 2014-02-05 19:50:45 UTC
Not sure.
When I do "sudo su" and then "echo $XSESSION" it is empty.
As a simple user "echo $XSESSION" returns "lxde"
As a simple user "sudo $XSESSION" also returns "lxde"
Comment 16 fcrvincent 2014-02-05 21:15:45 UTC
Found lightdm a good - and reliable alternative - to slim 
default background is a bit overloaded but it is easy to replace it with that of slim
Comment 17 fcrvincent 2014-02-12 12:55:31 UTC
After some further experiments it seems that the issue has to do with lxsession-0.4.9.2-r1 that randomly hangs after login. 

I could reproduce the issue both with Slim and Lightdm.

The hanging seems to be caused by the use of autossh in an script launched by lxsession autostart. 

The launch of autossh in the autostart file apparently causes a "python2 segfault in libX11.so.6.3.0" type error on login.

The workaround is to delay the launch of autossh by a few seconds in the script launched in the lxsession autostart. 

After this change I could login successfully and consistantly both through Slim and Lightdm.

This is weird and I may file a bug for lxsession-0.4.9.2-r1
Comment 18 Ian Stakenvicius (RETIRED) gentoo-dev 2014-02-12 14:52:33 UTC
Thanks for debugging this!  it was becoming quite a head-scratcher for me.