1

I have one machine (my main desktop, as it happens) where I've been unable to login from the display manager for months. As soon as I enter my password, it looks like it's about to start my session but then immediately exits and returns to the login prompt.

This happens no matter what display manager I use (i've tried several), or what session type I try (my usual is xfce, but I've tried lxde, kde, and others). At first I suspected it might have something to do with the creeping systemd-ification of everything desktop-related, but it happens whether I select sysvinit or systemd from the grub boot menu.

Logging in on a text console and running startx works perfectly.

My guess is that there's something in one of the xinit / xsession scripts that's exiting with a non-zero exit code, and set -e is killing the session.

This machine has been continuously upgraded (both hardware and software) since the mid 1990s, so there's a LOT of cruft. I don't want to rebuild the machine from scratch (that would be far too much work, getting everything set up again), but would like to fix this annoyance.

Any ideas on how to debug this? I've tried adding exec &> /tmp/Xsession.log and set -x to /etc/X11/Xsession but all I get is an empty log file.

BTW, the problem is not in my (equally old and crufty) dot-files, I created a new account cas2 and get the same problem logging in with that user. Or any other user on the system.

If I move cas2's home directory out of the way and give it a new, completely empty home directory, then logging in as cas2 gives me:

# find /home/cas2
/home/cas2
/home/cas2/.Xauthority
/home/cas2/.cache
/home/cas2/.cache/keyring-1L2ROY
/home/cas2/.cache/keyring-1L2ROY/control
/home/cas2/.xsession-errors

# ps u U cas2
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
cas2     15145  0.0  0.0 131040  2920 ?        Sl   20:22   0:00 /usr/bin/gnome-keyring-daemon --daemonize --login

the keyring daemon auto-kills itself not long after that.

  • 1
    Have you tried logging in on a text console and running the display manager in the foreground from there, in case you can get some error messages that way? – meuh Oct 9 '16 at 12:11
  • 1
    On what distribution? Chances are that /etc/X11/Xsession redirects to .xsession-errors early on. Post the full contents of that file. Have you customized anything under /etc/X11 or in the PAM stack? What appears in the system logs when you log in? – Gilles Oct 9 '16 at 20:49
  • @Gilles running debian, and .xsession-errors is empty. – cas Oct 9 '16 at 20:59
  • @meuh good idea, i'll try that when i get a chance. – cas Oct 9 '16 at 21:00
  • Had the same issue. For me it was a script I included at ~/.profile that caused the error (syntax error ^^). Found that hint inside /var/log/messages after trying to login. – Rudolf Jan 24 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.