Autologin with greetd sometimes not working

I’ve configured greetd and enabled the autologin feature. Now the strange thing is that after booting, sometimes the autologin works and I end up logged in and sometimes it does not and I get the agreety login prompt.

Does anyone have any idea how to make it consistenly log in after boot?

It is an EOS install without any DE selected during install and my greetd config looks as follows:

[terminal]
vt = 1

[default_session]
command = "agreety --cmd sway"
user = "greeter"

[initial_session]
command = "sway"
user = "sjiep"

I wonder if the timing of the session startup is affecting autologin. Perhaps sometimes the system is not fully ready when greetd tries to log in the user, so it fails.

Try adding a delay to the autologin command and see if it makes any difference.

[initial_session]
command = "sh -c 'sleep 2; sway'"
user = "sjiep"
1 Like

@BluishHumility Thanks for your suggestion. I’ve changed my config accordingly and rebooted a few times. So far it has always logged me in.

I will monitor it for the next few days and let you know how it goes (and mark it as solved if it behaves like it should).

1 Like