42

For some time I've seen some red text flashing by during boot. Today I decided to look into it. The systemctl service systemd-modules-load.service is failing with this text:

tomas@bonus-debian:~$ sudo systemctl status systemd-modules-load
● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since ma. 2015-11-09 02:58:48 CET; 5min ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 644 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 644 (code=exited, status=1/FAILURE)

nov. 09 02:58:48 bonus-debian systemd[1]: Starting Load Kernel Modules...
nov. 09 02:58:48 bonus-debian systemd-modules-load[644]: Failed to find module '-r usbhid'
nov. 09 02:58:48 bonus-debian systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
nov. 09 02:58:48 bonus-debian systemd[1]: Failed to start Load Kernel Modules.
nov. 09 02:58:48 bonus-debian systemd[1]: systemd-modules-load.service: Unit entered failed state.
nov. 09 02:58:48 bonus-debian systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.

I thought I'd start out by Googling the issue:

Screenshot

Ouch.

My system doesn't seem to mind that the driver failed to load, as I haven't noticed a degraded experience, but I'd still like to fix it.

Since Google got me nowhere, I'm stuck already. I have no idea where to start looking.

How do I figure out why systemctl service "systemd-modules-load" fails?

2
  • Did you change a udev rule, by any chance? Commented Nov 9, 2015 at 4:21
  • Can you check in journalctl for the logs? Is it trying to load a module named "-r usbhid"?
    – cristi
    Commented Nov 9, 2015 at 6:42

3 Answers 3

69

I too had this issue. I was able to solve it by following the instructions on the Arch Linux systemd wiki page. Here is a summary of what I did :

  1. Lets find the systemd services which fail to start

    $ systemctl --failed  
    ------------------------------------------------------------------------
    systemd-modules-load.service   loaded failed failed  Load Kernel Modules
    
  2. 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
    
  3. 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'
    
  4. 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  
    ...  
    
  5. 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  
    
  6. Now, try to start systemd-modules-load:

    $ systemctl restart 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.
    
5
  • 8
    Great answer – _PID= will now forever be in my toolbox. Thanks! Commented Jul 3, 2017 at 23:45
  • 2
    Unfortunately, my /etc/modules-load.d/ is empty, and it still says Failed to find module blah. What now?
    – Adrian
    Commented Oct 4, 2017 at 2:36
  • 3
    You may also want to check out journalctl _SYSTEMD_UNIT=systemd-modules-load.service. Saves looking up the PID.
    – TwoD
    Commented May 30, 2018 at 19:12
  • 2
    From user bobafetthotmail: look also in /usr/lib/modules-load.d/ for files loading modules, as there is where applications place the modules they need. The /etc/modules-load.d/ is supposed to be for user configuration files.
    – fixer1234
    Commented Sep 9, 2018 at 21:13
  • I got 0 loaded units listed.
    – West
    Commented Jul 6, 2022 at 17:39
1

In my case a simple

sudo update-initramfs -u

resolved the problem.

0

I had this issue because of an incomplete droidcam uninstallation. I kept seeing the same error on boot (systemd-modules-load failed) even though all traces of the rogue module had been removed. The reference to the module was in the initial ramdisk. I had to create a new initial ramdisk by running "dracut" as root. To generate a new ramdisk, using bash syntax:

cd /boot
mv initramfs-$(uname -r).img initramfs-$(uname -r).img-bak
dracut initramfs-$(uname -r).img
2
  • Dracut command not found Commented Jun 3, 2022 at 13:13
  • @RahulGupta you can install dracut with your system's package manager, eg. apt install dracut.
    – appas
    Commented Jan 15, 2023 at 5:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .