How to investigate systemd errors

systemd

(tom) #1

As an example, we will investigate an error with systemd-modules-load service:

  1. Lets find the systemd services which fail to start at boot time:
$ systemctl --state=failed
systemd-modules-load.service   loaded failed failed  Load Kernel Modules

or

$ systemctl --failed
systemd-modules-load.service   loaded failed failed  Load Kernel Modules
  1. Ok, we found a problem with systemd-modules-load service. We want to know more:
$ 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)

If the Process ID is not listed, just restart the failed service with systemctl restart systemd-modules-load

  1. Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current Process ID (here: 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'
  1. We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in /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
  1. The Failed to find module ‘blacklist usblp’ error message might be related to a wrong setting inside of blacklist.conf. Lets deactivate it with inserting a trailing # before each option we found via step 3:
/etc/modules-load.d/blacklist.conf

 blacklist usblp
# install usblp /bin/false
  1. Now, try to start systemd-modules-load:
$ systemctl start systemd-modules-load

If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.

If everything is ok, you can verify that the service was started successfully with:

$ 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.

also you can find errors in the journal:

journalctl -p err

source: https://wiki.archlinux.org/index.php/Systemd#Troubleshooting


Catalyst-utils: requires xorg-server<1.18.0
Important upgrades to groups of packages include linux, graphics, sound, qt5 and more
IOMMU -- usb: device descriptor read/64, error -32
Kernel modules not automatically loading