Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightdm does not "remember" user session #10349

Open
spinus opened this issue Oct 12, 2015 · 40 comments
Open

Lightdm does not "remember" user session #10349

spinus opened this issue Oct 12, 2015 · 40 comments

Comments

@spinus
Copy link
Member

spinus commented Oct 12, 2015

When you login with lightdm, usually (on other distros) lightdm saves your choice and when you type username next time, session will be switched to your previous choice and after entering the password it will login to that session.

In nixos (tested on 16.03) lightdm ignores all previous choices and login always to first session.

@spinus
Copy link
Member Author

spinus commented Oct 13, 2015

I actually have two installations (fresh, installed few days ago, two different machines). On one machine it saves the choice and doesn't on the other, I'll try to look more into it, if someone could confirm that or deny, would be nice.

@fps
Copy link
Contributor

fps commented Oct 14, 2015

Confirmed for me on channel nixos-15.09 here. Installed just a few days ago here, too..

@romildo
Copy link
Contributor

romildo commented Mar 22, 2016

On my unstable NixOS system lightdm is always pre-selecting the first entry in the sessions menu, and never remembers my last choice,

@spinus
Copy link
Member Author

spinus commented Mar 22, 2016

Just a blind guess.
What's your setup for:

users.mutableUsers = true; - this is mine (at least on the machine which
preserve selected session)

2016-03-22 11:58 GMT+00:00 José Romildo Malaquias notifications@github.com
:

On my unstable NixOS system lightdm is always pre-selecting the first
entry in the sessions menu, and never remembers my last choice,


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#10349 (comment)

Tomasz Czyż

@romildo
Copy link
Contributor

romildo commented Mar 22, 2016

On my configuration users.mutableUsers is not explicitly set, but according to the documentation, true is the default value.

@spinus
Copy link
Member Author

spinus commented Mar 22, 2016

Do you use any "proper" xsession manager? I'm using xfce session with
awesome window manager and the choice is preserved.
I can try later to test other options and report what's happening without
session manager (xterm, awesome).

Reference:
http://askubuntu.com/questions/65753/login-screen-doesnt-remember-my-choice-of-desktop-enviroment

2016-03-22 13:13 GMT+00:00 José Romildo Malaquias notifications@github.com
:

On my configuration users.mutableUsers is not explicitly set, but
according to the documentation, true is the default value.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#10349 (comment)

Tomasz Czyż

@romildo
Copy link
Contributor

romildo commented Mar 22, 2016

Currently I am using mainly xfce, and lightdm is not remembering latest session between reboots. But I think it should work without a session manager, as it does on other linux distributions. For instance in Gentoo Linux sometimes I use fluxbox or openbox or awesome, among others, without a session manager and lightdm remembers the latest session between reboots.

@spinus
Copy link
Member Author

spinus commented Mar 22, 2016

Maybe directory where lightdm user preferences are saved has wrong
permissions?

2016-03-22 14:56 GMT+00:00 José Romildo Malaquias notifications@github.com
:

Currently I am using mainly xfce, and lightdm is not remembering latest
session between reboots. But I think it should work without a session
manager, as it does on other linux distributions. For instance in Gentoo
Linux sometimes I use fluxbox or openbox or awesome, among others,
without a session manager and lightdm remembers the latest session
between reboots.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#10349 (comment)

Tomasz Czyż

@romildo
Copy link
Contributor

romildo commented Mar 22, 2016

Where would lightdm save user preferences? There is no file or directory with lightdm in its name on $HOME:

$ find $HOME -iname "*lightdm*" -or -iname ".*lightdm*"

No file is found.

On Gentoo Linux also there is no such file.

@spinus
Copy link
Member Author

spinus commented Mar 22, 2016

That's how it looks like on my box:

cd /var/lib/lightdm-data/ && ls -al

total 23
drwx------ 5 lightdm lightdm 6 Mar 22 15:24 .
drwxr-xr-x 18 root root 18 Dec 15 17:53 ..
drwxr-xr-x 4 lightdm lightdm 4 Mar 16 12:27 .cache
drwxrwx--- 2 lightdm lightdm 2 Mar 16 12:27 lightdm
drwxrwx--- 2 spinus lightdm 2 Oct 29 09:23 spinus
-rw------- 1 lightdm lightdm 52 Mar 16 12:27 .Xauthority

2016-03-22 15:07 GMT+00:00 José Romildo Malaquias notifications@github.com
:

Where would lightdm save user preferences? There is no file or directory
with lightdm in its name on $HOME:

$ find $HOME -iname "lightdm" -or -iname ".lightdm"

No file is found.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#10349 (comment)

Tomasz Czyż

@romildo
Copy link
Contributor

romildo commented Mar 22, 2016

On my system there is:

# ls -Al /var/lib/lightdm-data/
total 24
drwxr-xr-x 4 lightdm lightdm 4096 Mar 22 11:46 .cache
drwx------ 2 lightdm lightdm 4096 Mar 22 11:46 .emacs.d
drwxrwx--- 2 lightdm lightdm 4096 Mar 22 11:46 lightdm
drwxrwx--- 2 mike    lightdm 4096 Mar  9 18:16 mike
drwxrwx--- 2 romildo lightdm 4096 Apr 10  2015 romildo
-rw------- 1 lightdm lightdm   58 Mar 22 11:46 .Xauthority

Permissions seems to be the same as in your system.

@cumber
Copy link
Contributor

cumber commented Oct 29, 2016

I had this problem on 16.03. It seemed to be working 16.09, but after I switched to nixos-unstable it's happening again.

@pbogdan
Copy link
Member

pbogdan commented May 29, 2017

@cumber is still an issue for you? If so what do permissions and content look like on /var/lib/lightdm-data/.cache/lightdm-gtk-greeter/state as it seems that's where the session settings are stored.

@vcunat
Copy link
Member

vcunat commented May 29, 2017

I think there are some new problems there due to removal of patches. I'm getting failures to execute /bin/rm which might be related to lightdm clearing the state data.

@pbogdan
Copy link
Member

pbogdan commented May 29, 2017

@vcunat I couldn't quite figure out the state management - at a cursory glance lightdm process wants to clear out what it considers "stale" paths under /var/lib/lightdm-data/, including that .cache folder where the greeter wants to store its settings.. which sounds at odds with each other.
Wonder if perhaps that removal of patches actually fixes the issue here 😄

@vcunat
Copy link
Member

vcunat commented May 29, 2017

I'm not sure if it's related, but since recently I have to write out my username instead of it being pre-selected in a combobox.

@cumber
Copy link
Contributor

cumber commented May 30, 2017

@pbogdan No, it hasn't been bothering me for a while, but I redid how my session was configured a while ago, so I might only have the one option now... I'll see if I can verify

@pbogdan
Copy link
Member

pbogdan commented May 30, 2017

@vcunat hmm not sure - anything of interest in /var/log/seat?-greeter.log? what's your config look like?

@vcunat
Copy link
Member

vcunat commented May 30, 2017

I don't think I did any config at all. I just use one user from lightdm and one session; exceptions to that are very rare.

@pbogdan
Copy link
Member

pbogdan commented May 30, 2017

Could you check the contents of /var/lib/lightdm-data/.cache/lightdm-gtk-greeter/state when you are at lightdm's login prompt and see if your username is under the last-user key? If not what value do you get under that key?

@vcunat
Copy link
Member

vcunat commented May 30, 2017

Yes, it is there. Still, the UI only shows a plain input field for the username, without any hint of offering choice. (unstable+ NixOS)

@pbogdan
Copy link
Member

pbogdan commented May 30, 2017

And that's without any graphical sessions active - just lightdm sitting at the login prompt and inspecting the file via tty??

@cumber
Copy link
Contributor

cumber commented Jun 1, 2017

Yeah, it's working fine for me (shows my name in the drop down box, and remembers which session I last used), on both my nixos-17.03 machine and my nixos-unstable ones.

I used to use services.xserver.windowManager.xmonad to have xmonad as my window manager when this was a problem, relying on the builtin session configuration, but I've switched to installing my specific xmonad configuration to the store, and using:

  displayManager.session = [
    {
      manage = "window";
      name = "xmonad-custom";
      start = ''
        xmonad-custom &
        waitPID=$!
      '';
    }
  ];

I don't recall if making that switch was at the same time that it started working again.

@vcunat
Copy link
Member

vcunat commented Jun 1, 2017

@pbogdan: it has the GTK GUI, but it makes me just write the user name anyway. (No other graphical stuff is running.)

@cumber
Copy link
Contributor

cumber commented Aug 20, 2017

And this issue is back to affecting me too, now. It does give me a choice box, it's just sitting on "Other" (and there are no more options when I click on it), displaying a typeable username field underneath.

@cumber
Copy link
Contributor

cumber commented Oct 10, 2017

I just upgraded a machine from 17.03 to 17.09. That machine was remembering the session/user fine on 17.03, but now it always requires me to type my user name in.

(My earlier comment was about my nixos-unstable machines; I presume whatever changed happened sometime earlier and has just made it into the stable release).

@spinus
Copy link
Member Author

spinus commented Oct 10, 2017

I think we probably can close this if was solved in latest stable and older versions are not supported anymore.

@cumber
Copy link
Contributor

cumber commented Oct 10, 2017

@spinus It's the other way around, sadly. It worked correctly on 17.03, and has regressed sometime before 17.09.

@spinus
Copy link
Member Author

spinus commented Oct 10, 2017

The original bug I opened was about session choice, not necessarily about user selection. Actually I think in lightdm I always had to type the name (but I think this is because theme and has nothing to do with selection saving).

@cumber is the session selection preserved after you type the username?

@cumber
Copy link
Contributor

cumber commented Oct 10, 2017

@spinus Hmm, I had assumed it was the same mechanism for remembering both session and user that was failing.

I have only a single session configured now, so I can't tell. I could set up another as a test. Back when I had this issue previously (16.03?) it was definitely affecting both user and session.

@vcunat
Copy link
Member

vcunat commented Oct 16, 2017

I confirm that. On one machine lightdm (still) requires me to always type the user name. That started probably somewhere between 17.03 and 17.09.

@pbogdan
Copy link
Member

pbogdan commented Nov 3, 2017

FWIW I accidentally triggered the issue of username not being saved, in my specific case it was because of the user's shell not being listed in /etc/shells I had:

  users.extraUsers.pbogdan = {
     ...
     shell = pkgs.zsh;
  };

without programs.zsh.enable = true; set (which adds zsh to /etc/shells), and the accounts service daemon (that lightdm appears to use to query users) would no longer consider my user "human".
Forcefully disabling the accounts service also seems to work for this case as it makes lightdm fall back to querying /etc/passwd with slightly different logic that doesn't include validating the shell to the extent that accounts service does.

@cumber
Copy link
Contributor

cumber commented Nov 8, 2017

Ah, that's probably what's going on with me too, thanks @pbogdan! I have a custom build of zsh in my user level nix configuration, and my nixos configuration lists /home/cumber/.nix-profile/bin/zsh as my shell.

@cumber
Copy link
Contributor

cumber commented Nov 8, 2017

I can confirm adding environment.shells = [ "/home/cumber/.nix-profile/bin/zsh" ]; to my nixos configuration fixes the problem.

@JohnAZoidberg
Copy link
Member

JohnAZoidberg commented Jan 2, 2018

The problem is solved for me as well when adding programs.fish.enable = true; in addition to setting the shell of the user for exactly the reason @pbogdan explained. Thanks!
(NixOS 17.09)

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
@JohnAZoidberg
Copy link
Member

We could/should add all of the shells that are set for users to environment.shells. Then people wouldn't have to remember to add it there.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 13, 2020
@stale
Copy link

stale bot commented Dec 11, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 11, 2020
@fps
Copy link
Contributor

fps commented Dec 11, 2020

Just a note: It seems this bug is fixed on a current 20.03 system. I tried selecting several different windowmanagers in lightdm and it worked as expected (remembered the session choice across logouts.) So I guess this issue can be closed if some other reporters confirm as well.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 11, 2020
@oberblastmeister
Copy link
Contributor

I still have to add programs.zsh.enable = true for lightdm to remember my user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants