启动速度快,但从 GDM 提示符登录到桌面速度慢

启动速度快,但从 GDM 提示符登录到桌面速度慢

眼镜

  • Ubuntu 版本:20.10(groovy)
  • 存储:SATA SSD
  • 内存:8 GB DDR3
  • 处理器:AMD A8-4500M APU
  • 显卡:AMD Radeon HD 7640G

问题

据报告,启动速度非常快,仅需 14 秒systemd-analyze。但是从 GDM 提示符输入密码到进入桌面所需的时间相当长,为 7 秒(使用 Wayland 显示服务器)。默认 X11 显示服务器花费的时间更长,接近 10 秒。

这是全新安装,AMD 时钟加速已启用并处于活动状态,调节器。已加载ondemand默认开源图形驱动程序。radeon

每当我启动并登录 或者 注销然后登录

Apr  2 19:26:38 laptop org.gnome.Shell.desktop[2466]: Errors from xkbcomp are not fatal to the X server
Apr  2 19:26:50 laptop systemd[3224]: Not generating service for XDG autostart app-gnome\x2dsoftware\x2dservice-autostart.service, error parsing Exec= line: No such file or directory
Apr  2 19:26:50 laptop systemd[3224]: Not generating service for XDG autostart app-nautilus\x2dautostart-autostart.service, error parsing Exec= line: No such file or directory
Apr  2 19:26:51 laptop gnome-session[3368]: gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3384: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3384 does not exist.
Apr  2 19:26:51 laptop gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3384: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3384 does not exist.
Apr  2 19:26:51 laptop gnome-session[3368]: gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3387: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3387 does not exist.
Apr  2 19:26:51 laptop gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3387: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3387 does not exist.
Apr  2 19:26:54 laptop gnome-session[3368]: gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3518: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3518 does not exist.
Apr  2 19:26:54 laptop gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3518: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3518 does not exist.
Apr  2 19:26:54 laptop at-spi2-registr[3489]: Failed to register client: GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register client
Apr  2 19:26:54 laptop gnome-session[3368]: gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3551: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3551 does not exist.
Apr  2 19:26:54 laptop gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3551: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3551 does not exist.
Apr  2 19:26:54 laptop gnome-session[3368]: gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3556: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3556 does not exist.
Apr  2 19:26:54 laptop gnome-session-binary[3368]: GnomeDesktop-WARNING: Could not create transient scope for PID 3556: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 3556 does not exist.
Apr  2 19:26:54 laptop gnome-shell[3386]: Error looking up permission: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for geolocation

屏幕锁定后输入密码时不会出现延迟。有什么方法可以加快登录过程或诱使 GDM 自动登录但显示屏幕锁定,以便只有拥有凭据的用户才能访问系统。

由于我对 DE 和登录管理器的了解有限,我对该主题的研究只得出了一个旧的Ubuntu 维基文章似乎实施的

答案1

一种不太烦人的解决方法。可能不是最佳的安全做法。

  1. 启用自动登录
  2. 创建一个单元文件,用于启动后启动锁屏:/etc/systemd/system/lock_screen.service
[Unit]
Description=Lock screen after bootup since gdm login is slow
After=display-manager.service

[Service]
Type=simple
ExecStartPre=/usr/bin/sleep 5
ExecStart=/usr/bin/loginctl lock-sessions

[Install]
WantedBy=graphical.target 
  1. 启用它:systemctl enable lock_screen
  2. 重启
  3. 如果不起作用,就增加睡眠时间。

相关内容