You are not logged in.

#1 2015-07-13 00:24:07

bdantas
Member
Registered: 2014-05-13
Posts: 94

[SOLVED BY WORKAROUND] lightdm logs out after autologin

After a recent upgrade, lightdm sometimes logs me out immediately after autologin and puts me at its graphical login screen.

I know it sounds odd, but the problem seems to only happen once a day (the first time I boot). Subsequent boots on a given day are not affected (i.e., autologin works as expected). I have a near-vanilla install and I certainly have not configured my machine to do anything differently the first time that it boots on a given day.

Here are the relevant package versions:
  lightdm 1:1.14.0-3
  lightdm-gtk-greeter 1:2.0.1-2
  systemd 219-6
  mate 1.10

I've looked at the lightdm wiki and my /etc/lightdm/lightdm.conf is configured exactly as described there (https://wiki.archlinux.org/index.php/Li … _autologin). I am a member of the autologin group.

Also, I searched the forum before writing this post. I always deal with pacfiles immediately after upgrades, so this (https://bbs.archlinux.org/viewtopic.php?id=197796) is not applicable.

Any ideas on what I need to do in order for autologin to work consistently?

Last edited by bdantas (2015-07-14 18:28:11)

Offline

#2 2015-07-13 12:22:38

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: [SOLVED BY WORKAROUND] lightdm logs out after autologin

Here is the output of "sudo journalctl -b | grep lightdm" for my system's first boot today which replicated the problem (i.e., autologin, immediate logout--system kicks me out of my desktop after showing it very briefly--then a manual login):

Jul 13 08:08:02 Thinkpad lightdm[364]: ** (lightdm:364): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:08:02 Thinkpad lightdm[477]: pam_succeed_if(lightdm-autologin:auth): requirement "user ingroup autologin" was met by user "bruno"
Jul 13 08:08:02 Thinkpad lightdm[477]: gkr-pam: no password is available for user
Jul 13 08:08:02 Thinkpad lightdm[364]: ** (process:477): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:08:02 Thinkpad lightdm[477]: pam_unix(lightdm-autologin:session): session opened for user bruno by (uid=0)
Jul 13 08:08:06 Thinkpad lightdm[477]: pam_unix(lightdm-autologin:session): session closed for user bruno
Jul 13 08:08:07 Thinkpad lightdm[364]: ** (process:842): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:08:07 Thinkpad lightdm[842]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Jul 13 08:08:07 Thinkpad systemd[845]: pam_unix(systemd-user:session): session opened for user lightdm by (uid=0)
Jul 13 08:08:07 Thinkpad systemd-logind[357]: New session c2 of user lightdm.
Jul 13 08:08:07 Thinkpad systemd[1]: Started Session c2 of user lightdm.
Jul 13 08:08:07 Thinkpad systemd[1]: Starting Session c2 of user lightdm.
Jul 13 08:08:22 Thinkpad lightdm[364]: ** (process:865): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:08:22 Thinkpad lightdm[842]: pam_unix(lightdm-greeter:session): session closed for user lightdm
Jul 13 08:08:22 Thinkpad lightdm[865]: pam_unix(lightdm:session): session opened for user bruno by (uid=0)

After the above, I rebooted. Autologin worked fine. Here's the output of "sudo journalctl -b | grep lightdm" for that boot:

Jul 13 08:13:55 Thinkpad lightdm[354]: ** (lightdm:354): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:13:55 Thinkpad lightdm[471]: pam_succeed_if(lightdm-autologin:auth): requirement "user ingroup autologin" was met by user "bruno"
Jul 13 08:13:55 Thinkpad lightdm[471]: gkr-pam: no password is available for user
Jul 13 08:13:55 Thinkpad lightdm[354]: ** (process:471): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jul 13 08:13:55 Thinkpad lightdm[471]: pam_unix(lightdm-autologin:session): session opened for user bruno by (uid=0)

Interestingly (and unfortunately), the first five lines of the two outputs are exactly the same, so I don't understand what's triggering the "session closed" (sixth line) when I get kicked out.

Last edited by bdantas (2015-07-14 13:16:33)

Offline

#3 2015-07-14 11:47:24

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: [SOLVED BY WORKAROUND] lightdm logs out after autologin

Here's the contents of /var/log/lightdm/lightdm.log from a time when lightdm kicked me out after autologin:

[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.14.2, UID=0 PID=396
[+0.00s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.01s] DEBUG: Registered seat module xlocal
[+0.01s] DEBUG: Registered seat module xremote
[+0.01s] DEBUG: Registered seat module unity
[+0.07s] DEBUG: Monitoring logind for seats
[+0.07s] DEBUG: New seat added from logind: seat0
[+0.07s] DEBUG: Loading properties from config section SeatDefaults
[+0.07s] DEBUG: Seat seat0: Starting
[+0.07s] DEBUG: Seat seat0: Creating user session
[+0.07s] WARNING: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
[+0.07s] DEBUG: Loading user config from /etc/lightdm/users.conf
[+0.08s] DEBUG: User bruno added
[+0.08s] DEBUG: Seat seat0: Creating display server of type x
[+0.08s] DEBUG: Could not run plymouth --ping: Failed to execute child process "plymouth" (No such file or directory)
[+0.08s] DEBUG: Using VT 1
[+0.08s] DEBUG: Seat seat0: Starting local X display on VT 1
[+0.08s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+0.08s] DEBUG: DisplayServer x-0: Writing X server authority to /run/lightdm/root/:0
[+0.08s] DEBUG: DisplayServer x-0: Launching X Server
[+0.08s] DEBUG: Launching process 418: /usr/sbin/X :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt1 -novtswitch
[+0.08s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+0.08s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.09s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.71s] DEBUG: Got signal 10 from process 418
[+0.71s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+0.71s] DEBUG: DisplayServer x-0: Connecting to XServer :0
[+0.87s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+0.87s] DEBUG: Session pid=706: Started with service 'lightdm-autologin', username 'bruno'
[+0.90s] DEBUG: Session pid=706: Authentication complete with return value 0: Success
[+0.90s] DEBUG: Seat seat0: Session authenticated, running command
[+0.90s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0
[+0.90s] DEBUG: Session pid=706: Running command /etc/lightdm/Xsession mate-session
[+0.90s] DEBUG: Creating shared data directory /var/lib/lightdm-data/bruno
[+0.90s] DEBUG: Session pid=706: Logging to .xsession-errors
[+0.96s] DEBUG: Activating VT 1
[+0.96s] DEBUG: Activating login1 session c1
[+0.96s] DEBUG: Seat seat0 changes active session to c1
[+0.96s] DEBUG: Session c1 is already active
[+4.96s] DEBUG: Session pid=706: Exited with return value 0
[+4.96s] DEBUG: Seat seat0: Session stopped
[+4.96s] DEBUG: Seat seat0: Stopping display server, no sessions require it
[+4.96s] DEBUG: Sending signal 15 to process 418
[+5.11s] DEBUG: Process 418 exited with return value 0
[+5.11s] DEBUG: DisplayServer x-0: X server stopped
[+5.11s] DEBUG: Releasing VT 1
[+5.11s] DEBUG: DisplayServer x-0: Removing X server authority /run/lightdm/root/:0
[+5.11s] DEBUG: Seat seat0: Display server stopped
[+5.11s] DEBUG: Seat seat0: Active display server stopped, starting greeter
[+5.11s] DEBUG: Seat seat0: Creating greeter session
[+5.11s] DEBUG: Seat seat0: Creating display server of type x
[+5.11s] DEBUG: Using VT 1
[+5.11s] DEBUG: Seat seat0: Starting local X display on VT 1
[+5.11s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+5.11s] DEBUG: DisplayServer x-0: Writing X server authority to /run/lightdm/root/:0
[+5.11s] DEBUG: DisplayServer x-0: Launching X Server
[+5.12s] DEBUG: Launching process 5596: /usr/sbin/X :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt1 -novtswitch
[+5.12s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+5.38s] DEBUG: Got signal 10 from process 5596
[+5.38s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+5.38s] DEBUG: DisplayServer x-0: Connecting to XServer :0
[+5.39s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+5.39s] DEBUG: Session pid=6055: Started with service 'lightdm-greeter', username 'lightdm'
[+5.40s] DEBUG: Session pid=6055: Authentication complete with return value 0: Success
[+5.40s] DEBUG: Seat seat0: Session authenticated, running command
[+5.40s] DEBUG: Session pid=6055: Running command /usr/sbin/lightdm-gtk-greeter
[+5.40s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+5.40s] DEBUG: Session pid=6055: Logging to /var/log/lightdm/x-0-greeter.log
[+5.44s] DEBUG: Activating VT 1
[+5.44s] DEBUG: Activating login1 session c2
[+5.44s] DEBUG: Seat seat0 changes active session to c2
[+5.44s] DEBUG: Session c2 is already active
[+5.56s] DEBUG: Session pid=6055: Greeter connected version=1.14.2 resettable=false
[+5.65s] DEBUG: Session pid=6055: Greeter start authentication for bruno
[+5.65s] DEBUG: Session pid=6395: Started with service 'lightdm', username 'bruno'
[+5.66s] DEBUG: Session pid=6395: Got 1 message(s) from PAM
[+5.66s] DEBUG: Session pid=6055: Prompt greeter with 1 message(s)
[+34.29s] DEBUG: Session pid=6055: Continue authentication
[+34.31s] DEBUG: Session pid=6395: Authentication complete with return value 0: Success
[+34.31s] DEBUG: Session pid=6055: Authenticate result for user bruno: Success
[+34.31s] DEBUG: Session pid=6055: User bruno authorized
[+34.31s] DEBUG: Session pid=6055: Greeter sets language en_US.utf8
[+34.33s] DEBUG: Session pid=6055: Greeter requests session mate
[+34.33s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session
[+34.33s] DEBUG: Session pid=6055: Sending SIGTERM
[+34.33s] DEBUG: Session pid=6055: Greeter closed communication channel
[+34.33s] DEBUG: Session pid=6055: Exited with return value 0
[+34.33s] DEBUG: Seat seat0: Session stopped
[+34.33s] DEBUG: Seat seat0: Greeter stopped, running session
[+34.33s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session1
[+34.34s] DEBUG: Session pid=6395: Running command /etc/lightdm/Xsession mate-session
[+34.34s] DEBUG: Creating shared data directory /var/lib/lightdm-data/bruno
[+34.34s] DEBUG: Session pid=6395: Logging to .xsession-errors
[+34.35s] DEBUG: Activating VT 1
[+34.35s] DEBUG: Activating login1 session c3
[+34.35s] DEBUG: Seat seat0 changes active session to c3
[+34.35s] DEBUG: Session c3 is already active

And here's the same file, from a time when autologin worked fine:

[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.14.2, UID=0 PID=385
[+0.00s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.00s] DEBUG: Registered seat module xlocal
[+0.00s] DEBUG: Registered seat module xremote
[+0.00s] DEBUG: Registered seat module unity
[+0.02s] DEBUG: Monitoring logind for seats
[+0.02s] DEBUG: New seat added from logind: seat0
[+0.02s] DEBUG: Loading properties from config section SeatDefaults
[+0.02s] DEBUG: Seat seat0: Starting
[+0.02s] DEBUG: Seat seat0: Creating user session
[+0.02s] WARNING: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
[+0.02s] DEBUG: Loading user config from /etc/lightdm/users.conf
[+0.03s] DEBUG: User bruno added
[+0.03s] DEBUG: Seat seat0: Creating display server of type x
[+0.03s] DEBUG: Could not run plymouth --ping: Failed to execute child process "plymouth" (No such file or directory)
[+0.03s] DEBUG: Using VT 1
[+0.03s] DEBUG: Seat seat0: Starting local X display on VT 1
[+0.03s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+0.03s] DEBUG: DisplayServer x-0: Writing X server authority to /run/lightdm/root/:0
[+0.03s] DEBUG: DisplayServer x-0: Launching X Server
[+0.04s] DEBUG: Launching process 400: /usr/sbin/X :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt1 -novtswitch
[+0.04s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+0.04s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.04s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.86s] DEBUG: Got signal 10 from process 400
[+0.86s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+0.86s] DEBUG: DisplayServer x-0: Connecting to XServer :0
[+1.08s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+1.08s] DEBUG: Session pid=538: Started with service 'lightdm-autologin', username 'bruno'
[+1.12s] DEBUG: Session pid=538: Authentication complete with return value 0: Success
[+1.12s] DEBUG: Seat seat0: Session authenticated, running command
[+1.12s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0
[+1.13s] DEBUG: Session pid=538: Running command /etc/lightdm/Xsession mate-session
[+1.13s] DEBUG: Creating shared data directory /var/lib/lightdm-data/bruno
[+1.13s] DEBUG: Session pid=538: Logging to .xsession-errors
[+1.21s] DEBUG: Activating VT 1
[+1.21s] DEBUG: Activating login1 session c1
[+1.21s] DEBUG: Seat seat0 changes active session to c1
[+1.21s] DEBUG: Session c1 is already active

Last edited by bdantas (2015-07-14 13:18:00)

Offline

#4 2015-07-14 12:03:33

Awebb
Member
Registered: 2010-05-06
Posts: 6,298

Re: [SOLVED BY WORKAROUND] lightdm logs out after autologin

Just to rule this out: Did you try starting mate via startx/xinitrc?

Offline

#5 2015-07-14 12:26:43

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: [SOLVED BY WORKAROUND] lightdm logs out after autologin

Awebb, I am able to start MATE--that is not the problem. Sometimes LightDM automatically logs me in like it's supposed to. When autologin doesn't work (i.e., when lightdm kicks me out after autologin), it takes me to its graphical greeter where I can manually log in. I do not get kicked out after a manual login.

P.S. I did a complete upgrade on 7/13/15 to get the latest lightdm (1:1.14.2-1). Alas, the problem did not go away.

Last edited by bdantas (2015-07-14 12:48:06)

Offline

#6 2015-07-14 18:21:49

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: [SOLVED BY WORKAROUND] lightdm logs out after autologin

I decided to dump lightdm--on a computer with a single user, single DE, and single monitor such as mine, a display manager seems like an unnecessary complication.

Lo and behold, now autologin to my MATE desktop works consistently smile

Here's how to autologin to a Desktop Environment (MATE in my case) without using a display manager:

1. Get rid of your display manager (lightdm in my case):
$ sudo systemctl disable lightdm && sudo pacman -Rns lightdm lightdm-gtk-greeter

2. Rig systemd to autologin to virtual console by creating /etc/systemd/system/getty@tty1.service.d/autologin.conf with these contents (the repeated ExecStart is not a typo):
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin your_username --noclear %I 38400 linux
Type=simple

3. Copy /etc/X11/xinit/xinitrc to ~/.xinitrc; in latter, delete everything except the if statement pertaining to xinitrc.d, add "exec mate-session" at the bottom of the file

4. Add this line to ~/.bash_profile so that startx runs automatically when autologin happens:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

Note: If, like me, you don't want to see startx's output in the terminal, beware that simply redirecting startx's output (e.g., replacing "startx" with "startx &> ~/.startx.log") causes startx to stop working (!?).  I don't quite understand why this is the case, but folks whose kung fu is stronger than mine have figured out that replacing "startx" with "startx -- -keeptty &> ~/.startx.log" gets the job done.

References:
https://wiki.archlinux.org/index.php/Au … al_console (step 2)
https://wiki.archlinux.org/index.php/Xinitrc (step 3)
https://wiki.archlinux.org/index.php/Start_X_at_login (step 4)
https://bbs.archlinux.org/viewtopic.php?id=184496&p=3 (Note)

Last edited by bdantas (2015-07-22 14:23:13)

Offline

Board footer

Powered by FluxBB