You are not logged in.

#1 2022-01-31 12:53:08

lorhof1
Member
Registered: 2022-01-31
Posts: 10

[SOLVED] LightDM Autologin only works after logging in manually

Hello,
I have the problem that when I try to enable autologin in LightDM, I only get logged in automatically when I already have logged in manually via LightDM. Logging in in a tty does not change anything.

My lightdm.conf with commented lines removed:

[LightDM]

[Seat:*]
greeter-session=lightdm-gtk-greeter
session-wrapper=/etc/lightdm/Xsession
autologin-user=my-autologin-user

[XDMCPServer]

[VNCServer]

Edit: removed logind-check-graphical=true from section LightDM as it was a fix attempt which did not work

Edit 2: Relevant info from the lightdm log before manual login

DEBUG: Greeter start authentication for setup my-autologin-user
DEBUG: Session pid=525: Started with service 'lightdm', username my-autologin-user'
DEBUG: Session pid=525: Got 1 message(s) from PAM
DEBUG: Prompt greeter with 1 message(s)
DEBUG: Seat seat0 changes active session to
DEBUG: Seat seat0 changes active session to 2

and after manual login

DEBUG: Greeter start authentication for setup my-autologin-user
DEBUG: Session pid=525: Started with service 'lightdm', username my-autologin-user'
DEBUG: Session pid=525: Got 1 message(s) from PAM
DEBUG: Prompt greeter with 1 message(s)
DEBUG: Continue authentication

and some success messages.

Edit 3: More logs
Full system log: http://ix.io/3OqQ

Probably relevant:

Feb 02 14:30:00 myhostname audit[550]: USER_AUTH pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=pam_securetty,pam_shells,pam_faillock,pam_permit,pam_faillock acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname audit[550]: USER_ACCT pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname kernel: audit: type=1100 audit(1643812200.063:43): pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=pam_securetty,pam_shells,pam_faillock,pam_permit,pam_faillock acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname kernel: audit: type=1101 audit(1643812200.063:44): pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname kernel: audit: type=1103 audit(1643812200.066:45): pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_securetty,pam_shells,pam_faillock,pam_permit,pam_faillock acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname audit[550]: CRED_ACQ pid=550 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_securetty,pam_shells,pam_faillock,pam_permit,pam_faillock acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname login[550]: pam_unix(login:session): session opened for user my-autologin-user(uid=1000) by LOGIN(uid=0)

Feb 02 14:30:00 myhostname systemd-logind[351]: New session 2 of user my-autologin-user.

Feb 02 14:30:00 myhostname audit[585]: USER_ACCT pid=585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="my-autologin-user" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Feb 02 14:30:00 myhostname audit[585]: CRED_ACQ pid=585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=? acct="my-autologin-user" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

Feb 02 14:30:00 myhostname systemd[585]: pam_warn(systemd-user:setcred): function=[pam_sm_setcred] flags=0x8002 service=[systemd-user] terminal=[] user=[my-autologin-user] ruser=[<unknown>] rhost=[<unknown>]

Feb 02 14:30:00 myhostname systemd[585]: pam_unix(systemd-user:session): session opened for user my-autologin-user(uid=1000) by (uid=0)

Feb 02 14:30:00 myhostname audit[585]: USER_START pid=585 uid=0 auid=1000 ses=3 msg='op=PAM:session_open grantors=pam_loginuid,pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="my-autologin-user" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Feb 02 14:30:00 myhostname kernel: audit: type=1101 audit(1643812200.079:48): pid=585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="my-autologin-user" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Feb 02 14:30:00 myhostname kernel: audit: type=1103 audit(1643812200.079:49): pid=585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=? acct="my-autologin-user" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

Feb 02 14:30:00 myhostname audit[550]: USER_START pid=550 uid=0 auid=1000 ses=2 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname audit[550]: CRED_REFR pid=550 uid=0 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_securetty,pam_shells,pam_faillock,pam_permit,pam_faillock acct="my-autologin-user" exe="/usr/bin/login" hostname=myhostname addr=? terminal=/dev/tty6 res=success'

Feb 02 14:30:00 myhostname login[550]: LOGIN ON tty6 BY my-autologin-user

Feb 02 14:30:00 myhostname systemd[1]: Started Session 2 of User my-autologin-user.

Note that I logged in via tty to get the logs.

Last edited by lorhof1 (2022-02-03 07:26:40)

Offline

#2 2022-01-31 13:45:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

Check the lightdm log for errors, but since you're "logind-check-graphical=true" - iff this is bypassed for autologins you might want to look into https://wiki.archlinux.org/title/Kernel … _KMS_start
Ftr, you don't need to use lightdm or anydm if you want to autologin, eg. on effective single user systems I just log into a locked session.
https://wiki.archlinux.org/title/Getty# … al_console
https://wiki.archlinux.org/title/Start_X_at_login
and the xinitrc starts a locker.

Online

#3 2022-01-31 19:01:47

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

Check the lightdm log for errors, but since you're "logind-check-graphical=true" - iff this is bypassed for autologins you might want to look into https://wiki.archlinux.org/title/Kernel … _KMS_start
Ftr, you don't need to use lightdm or anydm if you want to autologin, eg. on effective single user systems I just log into a locked session.
https://wiki.archlinux.org/title/Getty# … al_console
https://wiki.archlinux.org/title/Start_X_at_login
and the xinitrc starts a locker.

There are some reasons I have to use LightDM. I added relevant parts of the log to my original post and noticed that check-graphical didn't do anything. I put it in my config because I thought it might help, it is removed now.

Last edited by lorhof1 (2022-01-31 19:02:11)

Offline

#4 2022-01-31 20:32:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

DEBUG: Session pid=525: Got 1 message(s) from PAM
DEBUG: Prompt greeter with 1 message(s)

PAM is clearly telling lightdm seomething that makes it return to the greeter, PAM logs to the system journal, so look there next.
Also see https://wiki.archlinux.org/title/LightD … st_attempt

Online

#5 2022-02-02 14:52:18

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:
DEBUG: Session pid=525: Got 1 message(s) from PAM
DEBUG: Prompt greeter with 1 message(s)

PAM is clearly telling lightdm seomething that makes it return to the greeter, PAM logs to the system journal, so look there next.
Also see https://wiki.archlinux.org/title/LightD … st_attempt

I now added the system journal to my post, but I do not see what to do with it.

Offline

#6 2022-02-02 15:18:57

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

There's just one (successful) login attempt on tty6 - is the autologin actually still active?

Online

#7 2022-02-02 15:27:51

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

There's just one (successful) login attempt on tty6 - is the autologin actually still active?

Yes, it is still active and the one on tty6 was me logging in to get the log.

Offline

#8 2022-02-02 15:30:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

lightdm isn't attempting to log you in here at all.
Sanity guess: is the autologin user in the autologin group, https://wiki.archlinux.org/title/LightD … _autologin ?

Online

#9 2022-02-02 15:35:45

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

lightdm isn't attempting to log you in here at all.
Sanity guess: is the autologin user in the autologin group, https://wiki.archlinux.org/title/LightD … _autologin ?

I'm creating the group with groupadd -r autologin
and creating the user with useradd -m -G wheel,autologin my-autologin-user.

Offline

#10 2022-02-02 15:51:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

Ok, but the remaining problem is that lightdm does not attempt to log in anyone at all in that journal (hence there's no failure to analyze)
Please post the complete lightdm log and your complete lightdm.conf and the complete system journal after a supposed autologin and actual login through lightdm has taken place.

Online

#11 2022-02-02 18:14:36

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

Ok, but the remaining problem is that lightdm does not attempt to log in anyone at all in that journal (hence there's no failure to analyze)
Please post the complete lightdm log and your complete lightdm.conf and the complete system journal after a supposed autologin and actual login through lightdm has taken place.

                After supposed autologin                | After actual login & reboot
lightdm log     http://ix.io/3Os1                         http://ix.io/3Os3
lightdm conf    http://ix.io/3OrZ                         http://ix.io/3OrZ
system journal  http://ix.io/3OrY                         http://ix.io/3Os5

Offline

#12 2022-02-02 20:23:42

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

[+0.10s] DEBUG: Seat seat0: Can't find session 'default'

Just a hunch (there's no failure in that log) - check the ~/.dmrc from a tty login and try to override the autologin session, https://wiki.archlinux.org/title/LightD … _autologin

Online

#13 2022-02-03 07:25:31

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:
[+0.10s] DEBUG: Seat seat0: Can't find session 'default'

Just a hunch (there's no failure in that log) - check the ~/.dmrc from a tty login and try to override the autologin session, https://wiki.archlinux.org/title/LightD … _autologin

I've never heard of ~/.dmrc before, but overriding the autologin session worked, thank you.

Offline

#14 2022-02-03 07:32:31

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

The  file should™ be there after you logged in w/ lightdm - the question is whether it gets removed before the autologin attempt.
And if not: what its contents are.

Online

#15 2022-02-03 08:26:42

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

The  file should™ be there after you logged in w/ lightdm - the question is whether it gets removed before the autologin attempt.
And if not: what its contents are.

That explains it: LightDM didn't log anyone in before the failed attempt, so there is no file to begin with

Offline

#16 2022-02-03 08:30:01

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,343

Re: [SOLVED] LightDM Autologin only works after logging in manually

when I try to enable autologin in LightDM, I only get logged in automatically when I already have logged in manually via LightDM

Did you try this with a fresh user every single time or delete the users $HOME?
The ~/.dmrc isn't supposed to vanish when you log out - on the contrary.

Edit: are you trying to build some live distro or so?

Last edited by seth (2022-02-03 08:30:21)

Online

#17 2022-02-03 11:30:34

lorhof1
Member
Registered: 2022-01-31
Posts: 10

Re: [SOLVED] LightDM Autologin only works after logging in manually

seth wrote:

when I try to enable autologin in LightDM, I only get logged in automatically when I already have logged in manually via LightDM

Did you try this with a fresh user every single time or delete the users $HOME?
The ~/.dmrc isn't supposed to vanish when you log out - on the contrary.

Edit: are you trying to build some live distro or so?

Yes, I'm trying to build something similar to a live distro. I reinstalled the system every time.

Offline

Board footer

Powered by FluxBB