How To Investigate Failed To Start Load Kernel Modules Error?

Failed to start Load Kernel Modules was a constant occurring during my system boot. I finally sat down and decided to investigate it.

The very first task is figure out which modules are causing the problem. For that we need the PID of process where modules fail.

[sudhir@workstation ~]$ sudo systemctl restart systemd-modules-load.service 
[sudo] password for sudhir: 
Job for systemd-modules-load.service failed because the control process exited with error code.
See "systemctl status systemd-modules-load.service" and "journalctl -xe" for details.
[sudhir@workstation ~]$ systemctl status systemd-modules-load.service
‚óŹ systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2017-02-23 21:36:05 IST; 12s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 29552 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 29552 (code=exited, status=1/FAILURE)

Feb 23 21:36:05 workstation systemd[1]: Starting Load Kernel Modules...
Feb 23 21:36:05 workstation systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Feb 23 21:36:05 workstation systemd[1]: Failed to start Load Kernel Modules.
Feb 23 21:36:05 workstation systemd[1]: systemd-modules-load.service: Unit entered failed state.
Feb 23 21:36:05 workstation systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.

The important line here is Main PID: 29552 (code=exited, status=1/FAILURE). We have the PID and now we can check journalctl for the faulty modules.

[sudhir@workstation ~]$ journalctl -b _PID=29552
-- Logs begin at Wed 2017-01-04 04:12:18 IST, end at Thu 2017-02-23 21:36:56 IST. --
Feb 23 21:36:05 workstation systemd-modules-load[29552]: Failed to find module 'vboxdrv'
Feb 23 21:36:05 workstation systemd-modules-load[29552]: Failed to find module 'vboxnetflt'
Feb 23 21:36:05 workstation systemd-modules-load[29552]: Failed to find module 'vboxnetadp'
Feb 23 21:36:05 workstation systemd-modules-load[29552]: Failed to find module 'vboxpci'

Now it became clear that the VirtualBox drivers are at fault. This is how you can investigate future system module failures.

Error Enabling Flyspell Mode

Emacs in Fedora 22 insist on using aspell as its default dictionary. Fedora when installed with locale other than en-US doesn’t seem to install aspell-en. This causes Flyspell mode to give following error.

Error enabling Flyspell mode:
(ispell-phaf: No matching entry for nil.
)

The above error can be fixed by adding following to your ~/.emacs which is taken from Chen Bin‘s spell check set up blog post.

;; find aspell and hunspell automatically
(cond
((executable-find "aspell")
(setq ispell-program-name "aspell")
(setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US")))
((executable-find "hunspell")
(setq ispell-program-name "hunspell")
(setq ispell-extra-args '("-d en_US")))
)

This doesn’t fully solve our problem. Starting Flyspell mode will give you following error.

Error enabling Flyspell mode:
(Error: No word lists can be found for the language "en_US".)

To resolve this issue you can install aspell-en.x86_64 as follows.

sudo dnf install aspell-en.x86_64