Login doesn't remember the last desktop session

Bug #818201 reported by Barry Warsaw on 2011-07-29
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Light Display Manager
High
Unassigned
lightdm (Ubuntu)
High
Unassigned

Bug Description

I log into Oneiric and choose the Ubuntu 2D desktop. Then I reboot and go to log in again, but lightdm doesn't remember that I chose Ubuntu 2D last time, so by default it will log me in with the default Ubuntu desktop.

Related branches

Sebastien Bacher (seb128) wrote :

thank you for your bug report, what lightdm version and greeter do you use?

Changed in lightdm (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Barry Warsaw (barry) wrote :

% apt-cache policy lightdm | grep -i install
  Installed: 0.9.2-0ubuntu4
% apt-cache policy lightdm-gtk-greeter | grep -i installed
  Installed: 0.9.2-0ubuntu4

Changed in lightdm (Ubuntu):
status: Incomplete → New
Sebastien Bacher (seb128) wrote :

what do you have in your user .dmrc?

Michael Terry (mterry) wrote :

I get this with:

[Desktop]
Language=en_US.utf8
Layout=us
Session=ubuntu-2d
Langlist=en_US:en
LCMess=en_US.UTF-8

Still defaults to normal Ubuntu and then (as expected) overrides the .dmrc with Session=Ubuntu if I log in with that.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Michael Terry (mterry) wrote :

This appears to be because of $HOME permissions denying other users read access to ~/.dmrc

Gunnar Hjalmarsson (gunnarhj) wrote :

Can possibly bug 823718 have anything to do with it?

Gunnar Hjalmarsson (gunnarhj) wrote :

On 2011-08-10 21:00, Michael Terry wrote:
> I get this with:
>
> [Desktop]
> Language=en_US.utf8
> Layout=us
> Session=ubuntu-2d
> Langlist=en_US:en
> LCMess=en_US.UTF-8

I think that the only of those keys that lightdm understands is "Session". The rest are set by gdm and may be removed.

> Still defaults to normal Ubuntu

Can't reproduce. With "Session=ubuntu-2d" in ~/.dmrc, Ubuntu 2D is pre-selected on my (gtk) greeter.

> and then (as expected) overrides the .dmrc with Session=Ubuntu if
> I log in with that.

If I select Ubuntu at login, lightdm sets "Session=gnome" in ~/.dmrc.

Changed in lightdm (Ubuntu):
importance: Low → High
Éric Araujo (merwok) wrote :

I have the same bug and my home directory is indeed not world-readable. I’d be happy to change that and restart lightdm if more confirmation is needed.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 0.9.3-0ubuntu6

---------------
lightdm (0.9.3-0ubuntu6) oneiric; urgency=low

  * Backport r1065 to use account service instead of .dmrc (lp: #823718),
    should fix the session not being correct remembered (lp: #818201)
 -- Sebastien Bacher <email address hidden> Tue, 23 Aug 2011 16:21:59 +0200

Changed in lightdm (Ubuntu):
status: Confirmed → Fix Released
Yves-Alexis Perez (corsac) wrote :

HOME permission don't matter as lightdm read/write them as root (and it's bad anyway).

It's still not fixed in 0.9.4 without account services, and account services doesn't look like a suitable dependency for a cross-desktop display manager.

Sebastien Bacher (seb128) wrote :

Yves-Alexis, what is wrong with accountsservice? It's a freedesktop prokject with desktop specific depends. Not that lightdm fallbacks to standard methods and don't hard depends on it

Yves-Alexis Perez (corsac) wrote :

See the thread on lightdm list for remarks about accountservice (and no, hosting it at freedesktop.org doesn't mean it's cross-desktop, right now the only way to tune stuff there is gnome-control-center).

I guess you meant “Note” instead of “Not” in the last sentence.

Right now this fallback is broken. Afaict it's because (I think) the current implementation in lightdm loads .dmrc (dmrc_load()) in start_user_session(), but it's too late. The current session as already been chosen (display->priv->user_session) and the key file loaded from dmrc_load isn't used at all:

    /* Load the users login settings (~/.dmrc) */
    dmrc_file = dmrc_load (user_get_name (user));

    /* Update the .dmrc with changed settings */
    g_key_file_set_string (dmrc_file, "Desktop", "Session", display->priv->user_session);
    dmrc_save (dmrc_file, user_get_name (user));
    g_key_file_free (dmrc_file);

    // FIXME: Copy old error file
    log_filename = g_build_filename (user_get_home_directory (user), ".xsession-errors", NULL);

    display->priv->session = create_session (display, authentication, display->priv->user_session, FALSE, log_filename);

I'm not completely sure the issues lies there or in the gtk-greeter (without user-list).

Yves-Alexis Perez (corsac) wrote :

Yes, confirmed, it's user-list related (so it might make sense to move that to another bug).

When I set greeter-hide-users=false, selecting the user in the list loads the correct session but not when manually entering the username.

If you want me to open another bug instead of continuing with this one, please say so.

Michael Terry (mterry) wrote :

Yes, please file a new report. That sounds like a different bug with a different solution.

Changed in lightdm:
status: New → Fix Released
status: Fix Released → New
Changed in lightdm:
importance: Undecided → High
status: New → Fix Released

I have a similar issue with regards to guest sessions. I've tried to manually set the dmrc in /usr/sbin/guest-account, but that doesn't work. I suppose there is a reason why those lines are commented. I've also tried adding it to /etc/guest-session/skel/.dmrc, but that also doesn't work.

When I say "doesn't work", I mean that after login, $/home/.dmrc uses Session=ubuntu no matter what I do. This is bad, because some users have setups that are capable of running Unity, but get a much better performance with Unity 2D. Of course, you might want to let the guests use the same shell as you're using yourself.

> Yves-Alexis, what is wrong with accountsservice? It's a freedesktop prokject with desktop specific depends. Not that lightdm fallbacks to standard methods and don't hard depends on it

Well, the problem is that AccountsService is not really suited for network logins since it stores the session and language selection to /var/lib/AccountsService/users which is a local directory whereas saving it to ${HOME}/.dmrc makes the settings available on any login computer.

Currently, lightdm is completely broken when it comes to loading the last session on a network, even with version 1.4.0. It simply doesn't work.

Honestly, it's frustrating that many upstream developers of desktop components like the display manager always seem to completely ignore everything which goes beyond single-user or single-machine systems.

Cheers,

Adrian

Sebastien Bacher (seb128) wrote :

@Adrian:

I can understand your frustration but the statement "that many upstream developers of desktop components like the display manager always seem to completely ignore everything which goes beyond single-user or single-machine systems." is wrong, there are bugs though and people working on a local system might not easily hit and notice those...

the bug you are commenting on is closed though, could you open a new one with the issues you noticed?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers