问题描述
系统为Ubuntu18.04,预先未安装lightdm,原本默认图形界面为gdm3。在教程的指导下完成lightdm安装,通过systemctl启动lightdm服务时报错,log如下:
$ sudo systemctl start lightdm.service
$ sudo systemctl status lightdm.service
● lightdm.service - Light Display Manager
Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
Active: inactive (dead) since Mon 2021-04-19 17:24:00 CST; 4min 0s ago
Docs: man:lightdm(1)
4月 19 17:26:59 lightdm[4621]: access control disabled, clients can connect from any host
4月 19 17:26:59 lightdm[6015]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
4月 19 17:26:59 lightdm[6151]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
4月 19 17:26:59 lightdm[6151]: PAM adding faulty module: pam_kwallet.so
4月 19 17:26:59 lightdm[6151]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
4月 19 17:26:59 lightdm[6151]: PAM adding faulty module: pam_kwallet5.so
4月 19 17:26:59 lightdm[6151]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "yuyize"
4月 19 17:27:03 lightdm[6151]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:27:03 lightdm[6151]: pam_sss(lightdm:auth): authentication success; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:27:03 lightdm[6151]: pam_unix(lightdm:session): session opened for user yuyize by (uid=0)
主要错误为:
PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
解决办法
该链接给出解决方案:
https://forums.linuxmint.com/viewtopic.php?t=286950
即:
- 对
/etc/pam.d/lightdm
和/etc/pam.d/lightdm-greeter
这两个配置文件进行编辑:
$ sudo gedit /etc/pam.d/lightdm
$ sudo gedit /etc/pam.d/lightdm-greeter
- 分别将两个文件中以下几行代码注释掉(行起始处插入
#
)
auth optional pam_kwallet.so
auth optional pam_kwallet5.so
session optional pam_kwallet.so auto_start
session optional pam_kwallet5.so auto_start
- 注销后重新登录账户,使用
systemctl start lightdm
命令重新启动lightdm服务,再通过systemctl status lightdm
可以看到lightdm成功启动
$ sudo systemctl status lightdm.service | more
● lightdm.service - Light Display Manager
Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
Active: active (running) since Mon 2021-04-19 17:24:00 CST; 24min ago
Docs: man:lightdm(1)
Process: 4618 ExecStartPre=/bin/sh -c [ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ] (code=exited, status=0/SUCCESS)
Main PID: 4621 (lightdm)
Tasks: 21 (limit: 4915)
CGroup: /system.slice/lightdm.service
├─4621 /usr/sbin/lightdm
└─8215 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
4月 19 17:27:03 lightdm[6151]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:27:03 lightdm[6151]: pam_sss(lightdm:auth): authentication success; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:27:03 lightdm[6151]: pam_unix(lightdm:session): session opened for user yuyize by (uid=0)
4月 19 17:47:55 lightdm[4621]: access control disabled, clients can connect from any host
4月 19 17:47:55 lightdm[4621]: access control disabled, clients can connect from any host
4月 19 17:47:55 lightdm[8259]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
4月 19 17:47:56 lightdm[8394]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "yuyize"
4月 19 17:47:59 lightdm[8394]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:47:59 lightdm[8394]: pam_sss(lightdm:auth): authentication success; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=yuyize
4月 19 17:47:59 lightdm[8394]: pam_unix(lightdm:session): session opened for user yuyize by (uid=0)