Score:0

Login Greeter takes 20~30 sec (after bootup apparently finished) to appear

cn flag

I looked into this question among a few others (on and off SO) for a solution.

The upvoted (but not accepted) answer to that question, suggests entropy might be a problem. I have infact from the beginning both haveng and rng-tools installed and enabled, and the entropy is pretty high (as per the comments on that answer, which suggest something close to 4000 as a good value).

$ cat /proc/sys/kernel/random/entropy_avail
$ 3703

I disabled a bunch of services, like Docker, lxc, etc that I thought might have been slowing down the boot process. Here is the critical-chain output after that. I don't think, there are any unnecessary services being started.

$ systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @18.632s
└─multi-user.target @18.632s
  └─ModemManager.service @12.750s +3.349s
    └─polkit.service @9.288s +3.409s
      └─basic.target @8.854s
        └─sockets.target @8.854s
          └─libvirtd-admin.socket @8.854s
            └─libvirtd.socket @8.848s +5ms
              └─sysinit.target @8.817s
                └─systemd-sysctl.service @8.795s +21ms
                  └─systemd-modules-load.service @2.849s +5.941s
                    └─systemd-journald.socket @2.737s
                      └─-.mount @2.733s
                        └─system.slice @2.733s
                          └─-.slice @2.733s

Here is my lightdm.log.

[+7.13s] DEBUG: Process 1994 exited with return value 0
[+7.13s] DEBUG: Seat seat0: Exit status of /sbin/prime-offload: 0
[+7.13s] DEBUG: posix_spawn avoided (fd close requested) (child_setup specified) 
[+7.13s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+7.13s] DEBUG: Session pid=1999: Started with service 'lightdm-greeter', username 'lightdm'
[+7.40s] DEBUG: Session pid=1999: Authentication complete with return value 0: Success
[+7.40s] DEBUG: Seat seat0: Session authenticated, running command
[+7.40s] DEBUG: Session pid=1999: Running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter
[+7.40s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+7.40s] DEBUG: Session pid=1999: Logging to /var/log/lightdm/seat0-greeter.log
[+30.54s] DEBUG: Activating VT 7
[+30.54s] DEBUG: Activating login1 session c1
[+30.54s] DEBUG: Seat seat0 changes active session to c1
[+30.54s] DEBUG: Session c1 is already active
[+48.16s] DEBUG: Greeter connected version=1.30.0 api=1 resettable=false
[+49.90s] DEBUG: Greeter start authentication for junaid
[+49.90s] DEBUG: Session pid=6578: Started with service 'lightdm', username 'junaid'
[+49.92s] DEBUG: Session pid=6578: Got 1 message(s) from 

I already tried switching to amdgpu-pro drivers from the amd website and that changed nothing. I reverted to the open source drivers.

I have also switched from lightdm to sddm and to gdm3 alternatively. Here is the output for that.

  • With lightdm
$ systemd-analyze
Startup finished in 7.564s (kernel) + 18.663s (userspace) = 26.228s 
graphical.target reached after 18.632s in userspace

With lightdm, I just have a blank screen for ~30 seconds before the greeter appears.

  • With sddm
$ systemd-analyze
Startup finished in 6.667s (kernel) + 16.169s (userspace) = 22.837s 
graphical.target reached after 16.155s in userspace

Interesting thing about sddm is, the mouse cursor (although frozen) already appears almost immediately but the greeter does not appear for the next ~20 seconds.

  • With gdm3
$ systemd-analyze
Startup finished in 6.562s (kernel) + 52.061s (userspace) = 58.624s 
graphical.target reached after 52.047s in userspace
$ systemd-analyze blame
41.779s plymouth-quit-wait.service                                               
 5.738s systemd-modules-load.service                                             
 5.519s udisks2.service                                                          
 4.411s networkd-dispatcher.service                                              
 3.809s accounts-daemon.service                                                  
 3.443s [email protected]                                                      
 3.011s qemu-kvm.service                                                         
 2.930s uml-utilities.service                                                    
 2.614s dev-sdb5.device                                                          
 2.459s ModemManager.service                                                     
 2.205s polkit.service                                                           
 2.158s avahi-daemon.service                                                     
 2.136s NetworkManager.service                                                   
 2.124s dundee.service                                                           
 2.005s ofono.service                                                            
 1.958s gpu-manager.service                                                      
 1.920s grub-common.service  
...

And finally Syslog shows that the kernel goes through with the bootup pretty fast (~4sec), till the following snags hit, taking up 20~30 seconds, which is about the time the screen remains blank&unresponsive before the login screen appears.

Dec 18 12:04:03 my-desktop NetworkManager[1057]: <info>  [1639825443.5387] manager: NetworkManager state is now CONNECTED_GLOBAL
Dec 18 12:04:13 my-desktop systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Dec 18 12:04:22 my-desktop systemd[1]: systemd-fsckd.service: Succeeded.
Dec 18 12:04:22 my-desktop systemd-timesyncd[996]: Initial synchronization to time server 91.189.89.199:123 (ntp.ubuntu.com).
Dec 18 12:04:26 my-desktop systemd[1]: systemd-hostnamed.service: Succeeded.
Dec 18 12:04:40 my-desktop systemd[1]: Created slice User Slice of UID 1000.

With gdm3, the boot-splash screen remains frozen for ~30 seconds before the login greeter appears.

I have a not so bad system put together a couple of years ago, with Ryzen 7 processor, 32GB RAM, 256GB SSD for the OS, and I am using an up to date Ubuntu 20.04 LTS.

So if there is a solution to this problem, it has eluded me in the last 2~3 hours.

Score:0
in flag

I had this problem in Ubuntu 20.04.3 in a Lenovo Thinkbook. The problem is related to the fingerprint reader login option which does not work properly. I removed this option and it works perfectly.

You can verify it is running in a terminal with journalctl -f. Then you lock the screen (in my case Windows key + L) and log again and see the results of the process. That will show the elements calling during the login process.

Duck Dodgers avatar
cn flag
Hi @Cesar, thanks for the answer. Actually, I have a desktop PC (and not a laptop). But I tried it just now anyways. I did not see anything about a finger print reader. There was just one message about unlocking the gnome-keyring when I locked and then unlocked the screen.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.