Unable to log in if user has invalid session configured and no session switcher shown

Bug #1303725 reported by Jonathan on 2014-04-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-greeter (Ubuntu)
Robert Ancell

Bug Description

I was having some unrelated problems with unity, so I temporarily removed it which caused me to stumble across this problem.
I have gnome also installed on my system, and was planning to use it in the meanwhile. After I removed unity and reboot my computer, I noticed the session selector disappeared. From the ubuntu wiki I found this information:
The session switcher will only show up if you have more than one VALID session; a valid session is one that points to a valid executable.

This would be fine, except for lightdm assumed that the one session available was 'ubuntu.' I could not change the session because the selector was missing. Every attempt to log in would begin to appear as if it worked, but then I would just be stuck looking at the background image and nothing else.

I looked though the logs and found these lines in x-0-greeter.log
[+0.03s] DEBUG: Connected version=1.8.5 default-session=ubuntu show-manual-login=false hide-users=false has-guest-account=true show-remote-login=true
[+0.09s] DEBUG: Ignoring session /usr/share/xsessions/ubuntu.desktop
[+0.09s] DEBUG: Loaded session /usr/share/xsessions/gnome.desktop (GNOME, This session logs you into GNOME)
[+1.79s] DEBUG: Authentication complete for user jonathan with return code 0
[+1.79s] DEBUG: Starting session ubuntu

So I changed the default session from 'ubuntu' to 'gnome', by running the following command:
sudo /usr/lib/lightdm/lightdm-set-defaults --session gnome
(I also verified in /etc/lightdm/lightdm.conf that it worked)

This time around the log showed that default-session=gnome, but still attempted to load 'ubuntu' regardless. The only way I was ever able to get into gnome was by making a copy of gnome.desktop in /usr/share/xsessions, renaming the copy to ubuntu.desktop, forcing the session switcher to reappear. It worked, but it's a little bit hackish.

Related branches

Changed in lightdm:
status: New → Triaged
importance: Undecided → Medium
Changed in lightdm (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in lightdm:
importance: Medium → Low
summary: - Lightdm incorrectly assumes if there is only one session, that session
- is 'ubuntu' (and ignores .conf)
+ Greeter doesn't allow to switch sessions if only one session installed
+ (user is set to old session)
no longer affects: lightdm
affects: lightdm (Ubuntu) → unity-greeter (Ubuntu)

I think the problem is:
1. You log into a standard install
2. You log out
3. You install GNOME and uninstall Unity
4. You attempt to log in

The configured session for your user is "ubuntu" but this session is no longer available. Unity Greeter doesn't show a session switcher since only one valid session is installed (GNOME).

The solution is for unity-greeter to detect that your configured session is not available and show a session switcher / or just log you into the default.

Robert Ancell (robert-ancell) wrote :

The configured session is stored in a d-bus service called AccountsService.

You can change this by:
$ gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts --method org.freedesktop.Accounts.FindUserByName your-username
(objectpath '/org/freedesktop/Accounts/User1000',)
$ gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts/User1000 --method org.freedesktop.Accounts.User.SetXSession your-session

Or editing /var/lib/AccountsService/users/bob (you probably have to restart accounts service / your machine to take effect).

summary: - Greeter doesn't allow to switch sessions if only one session installed
- (user is set to old session)
+ Unable to log in if user has invalid session configured and no session
+ switcher shown
tags: added: ubuntu-desktop-trusty
Changed in unity-greeter (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Robert Ancell (robert-ancell)
Changed in unity-greeter (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-greeter - 14.04.9-0ubuntu1

unity-greeter (14.04.9-0ubuntu1) trusty; urgency=medium

  * New upstream release:
    - Correctly handle SIGTERM and quit cleanly. We were previously not stopping
      the signal and so not cleaning up on exit. This left an upstart process
      for each greeter remaining.
    - If a user has an invalid session, then use the system default session
      (LP: #1303725)
    - Correctly handle sessions not starting
 -- Robert Ancell <email address hidden> Tue, 08 Apr 2014 15:57:59 +1200

Changed in unity-greeter (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers