如何查看“snapd.refresh.service”为何无法在启动时启动?

如何查看“snapd.refresh.service”为何无法在启动时启动?

升级到snapd版本后2.0.8,我注意到我收到一条关于snapd.refresh.service启动时无法启动的错误消息,该错误告诉我要运行哪个命令才能查看失败的原因,但是该消息消失得太快,我看不到该命令是什么。

我知道这可能是一个错误,我打算报告它,但是我想知道是否有人知道这可能是一个命令?我认为它可能是一个命令,systemd但我并不完全确定。是否有地方记录了该消息(我已经尝试过 syslog,dmesg但它不在那里)?

我正在运行带有 GNOME 3.20 的 Ubuntu GNOME 16.04。


对于任何感兴趣的人,已经有一个关于此事的报告这里

答案1

您还可以使用systemctl status它查看日志的尾部,以及 systemd 有关该服务的任何其他信息:

systemctl status snapd.refresh.service

例如:

$ systemctl status lightdm.service   
● lightdm.service - Light Display Manager
   Loaded: loaded (/lib/systemd/system/lightdm.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/lightdm.service.d
           └─override.conf
        /lib/systemd/system/display-manager.service.d
           └─xdiagnose.conf
   Active: active (running) since Sun 2016-06-12 09:27:09 IST; 2 days ago
     Docs: man:lightdm(1)
 Main PID: 2218 (lightdm)
   CGroup: /system.slice/lightdm.service
           ├─2218 /usr/sbin/lightdm
           └─2245 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Jun 12 09:27:12 host lightdm[2278]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
Jun 12 09:27:12 host lightdm[2278]: PAM adding faulty module: pam_kwallet5.so
Jun 12 09:27:13 host lightdm[2278]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Jun 12 09:27:28 host lightdm[2490]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Jun 12 09:27:28 host lightdm[2490]: PAM adding faulty module: pam_kwallet.so
Jun 12 09:27:28 host lightdm[2490]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
Jun 12 09:27:28 host lightdm[2490]: PAM adding faulty module: pam_kwallet5.so
Jun 12 09:27:28 host lightdm[2490]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "muru"
Jun 12 09:27:36 host lightdm[2490]: pam_unix(lightdm:session): session opened for user muru by (uid=0)
Jun 15 05:53:19 host systemd[1]: [/etc/systemd/system/lightdm.service.d/override.conf:2] Executable path is not absolute, ignoring: true

注意事项:

  • 服务的状态(启用/禁用)以及供应商设置的状态(在本例中为包)
  • 服务文件的位置,以及任何覆盖文件(“Drop-In”文件)的位置
  • PID、cgroup 和子进程

答案2

要显示该单元的 systemd 日志snapd.refresh.service,请使用:

journalctl -u snapd.refresh.service

相关内容