让我们找到无法启动的系统服务
$ systemctl --failed
------------------------------------------------------------------------
systemd-modules-load.service loaded failed failed Load Kernel Modules
好的,我们发现systemd-modules-load服务存在问题。我们想了解更多。
$ systemctl status systemd-modules-load
------------------------------------------------------------------------
systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
Active: failed (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago
Docs: man:systemd-modules-load.service(8).
man:modules-load.d(5)
Process: 15630 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
如果未列出进程ID,请使用以下命令重新启动失败的服务
$ systemctl restart systemd-modules-load
现在,我们有了进程ID(PID),可以深入研究此错误。输入具有当前进程ID的以下命令(此处:15630):
$ journalctl _PID=15630
----------------------------------------------------------------------
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --
Aug 25 11:48:13 mypc systemd-modules-load[15630]: Failed to find module 'blacklist usblp'
Aug 25 11:48:13 mypc systemd-modules-load[15630]: Failed to find module 'install usblp /bin/false'
我们看到某些内核模块配置有错误的设置。因此,我们在/etc/modules-load.d/中查看这些设置。
$ ls -Al /etc/modules-load.d/
----------------------------------------------------------------------
...
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf
...
无法找到模块“ blacklist usblp”错误消息可能与blacklist.conf中的错误设置有关。让我们通过在步骤3找到的每个选项之前插入尾随#来停用它:
/etc/modules-load.d/blacklist.conf
----------------------------------------------------------------------
# blacklist usblp
# install usblp /bin/false
现在,尝试启动systemd-modules-load:
$ systemctl restart systemd-modules-load
如果成功,则不应提示任何内容。如果看到任何错误,请返回步骤3并使用新的PID来解决剩余的错误。
如果一切正常,则可以使用以下命令验证服务是否已成功启动:
$ systemctl status systemd-modules-load
----------------------------------------------------------------------
systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
Active: active (exited) since So 2013-08-25 12:22:31 CEST; 34s ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)
Aug 25 12:22:31 mypc systemd[1]: Started Load Kernel Modules.
udev
有机会更改规则?