-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nixos: xserver.displayManager: use slim for automatic logins #46396
Conversation
`lightdm` is not that light for automatic logins: it runs two processes three threads each (while slim runs one of each) all of which stay in memory even after login is finished. Meanwhile, `auto` users usually want the display manager to get out of their way, not to pollute their system with six useless threads. Moreover, the closure size of slim+theme in its default config in NixOS is 53M, while the similar closure size of lightdm+greeter+theme is 254M. This reverts a part of commit fc035da.
This reverts commit 5f72169.
This reverts commit 7e9bd2d. No longer needed after the previous commit.
If this is merged (I don't have a strong opinion about it), it should be backported to 18.09 because it can be a pain to debug/fix NixOS tests if the basic test setup is different between master and 18.09. |
user = cfg.user; | ||
}; | ||
autoLogin = true; | ||
defaultUser = cfg.user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue with this PR but we should standardize the settings so autoLogin
works the same regardless of DM.
Ping. I still think this need to be merged.
Let me remind you that this also fixes
- Normally I `exec xmonad` at the end of `.xsession`. With `lightdm` exiting `xmonad` brings the system into an unusable state, `lightdm` just keeps running, showing its background window as if nothing happened, and you have to login in another tty and restart `display-manager` manually to get anything done.
mentioned in #30890 (comment)
Also of note since the switch to `lightdm` are the following discourse topics
https://discourse.nixos.org/t/stuck-with-a-failing-lightdm/930/1 and
https://discourse.nixos.org/t/how-to-upgrade-from-18-03-to-18-09/933/1
Both have "`lightdm` doesn't works until you rebuild and reboot your system several times" symptoms, no idea why or what, but looks interesting.
|
This PR also fixes another bug: if the desktop manager crashes, it causes lightdm to restart but it won't auto-login again, therefore getting stuck at the 'enter password' screen. |
The "bug" about lightdm not doing auto-login on crash (haven't checked, but I suspect it's when the session exits non-zero) is imo not a bug. This reduces the risk of a broken session causing a tight loop with the display manager I do not know how to approach this appropriately, but maybe some tip in the documentation that for unattended autologin slim would be more appropriate due to that behaviour, while the behaviour from lightdm is preferred on an end-user's machine. |
@samueldr IMO your scenario is more appropriately handled by lightdm exiting with a non-zero status (assuming the DM exited with a non-zero status) and letting systemd auto-restart the This might be what slim does already, although I haven't verified it yet. |
Ok, I have verified that To check this behavior, I have performed a bunch of Note that nixpkgs/nixos/modules/services/x11/xserver.nix Lines 684 to 687 in 3223534
To be clear, note that So to summarize, IMHO I think this PR fixes a bunch of issues with auto-login and I think it should either be merged or |
Looks like lightdm has an open issue. |
Slim was removed in #73251, I think this can be closed |
No, the correct way now is to revert #73251 and then merge this. The OP issue still persists.
|
This reverts commit 4583e29, reversing changes made to d6fa540. The fact that SLiM is not officially actively maintained is not a good reason to remove it. It works, and, in some instances, like automatic logins, it is the only thing that actually works. See NixOS#46396 and NixOS#30890 (comment).
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:
|
I marked this as stale due to inactivity. → More info |
Motivation for this change
lightdm
is not that light for automatic logins: it runs two processes three threads each (while slim runs one of each) all of which stay in memory even after login is finished. Meanwhile,auto
users usually want the display manager to get out of their way, not to pollute their system with six useless threads. Moreover, the closure size of slim+theme in its default config in NixOS is 53M, while the similar closure size of lightdm+greeter+theme is 254M.Things done