5

I'd like to control my monitor brightness with ddcutil, which requires the i2c-dev module to be loaded.

It is not loaded automatically, so I'm following the directions on ArchWiki to try to automatically load it with systemd. systemd-modules-load.service has no errors, yet the module isn't loaded on boot.

# Not loaded
[rcorre@midova ~]$ sudo ddcutil setvcp 10 10
Display not found

# But I've got a file in modules-load.d
[rcorre@midova ~]$ cat /etc/modules-load.d/i2c-dev
i2c-dev

# The logs have always been rotated on boot ...
[rcorre@midova ~]$ sudo systemctl status systemd-modules-load
● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: active (exited) since Thu 2019-09-05 06:51:35 EDT; 14min ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
 Main PID: 449 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/systemd-modules-load.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

# ... so I try restarting the service
[rcorre@midova ~]$ sudo systemctl restart systemd-modules-load
[rcorre@midova ~]$ sudo systemctl status systemd-modules-load
● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: active (exited) since Thu 2019-09-05 07:10:19 EDT; 14s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 8189 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)
 Main PID: 8189 (code=exited, status=0/SUCCESS)

Sep 05 07:10:19 midova systemd[1]: Stopping Load Kernel Modules...
Sep 05 07:10:19 midova systemd[1]: Starting Load Kernel Modules...
Sep 05 07:10:19 midova systemd[1]: Started Load Kernel Modules.

# Still no luck
[rcorre@midova ~]$ sudo ddcutil setvcp 10 10
Display not found

# But I can load it manually
[rcorre@midova ~]$ sudo modprobe i2c-dev
[rcorre@midova ~]$ sudo ddcutil setvcp 10 10
rcorre
  • 276
  • 2
  • 6
  • 14

2 Answers2

3

Each configuration file is named in the style of /etc/modules-load.d/<program>.conf.

The .conf suffix is required for modules-load.d – other files are ignored. (This is how the program distinguishes between actual configuration and leftover backups, e.g. various distros' .pacnew/.rpmnew files.)

grawity
  • 501,077
-1

There are a few ways to run modprobe during boot. If you have LXDE as your desktop, you can put modprobe i2c-dev in ~/.config/lxsession/LXDE/autostart as a new line containing @sudo modprobe i2c-dev. I haven't tried other methods of this for boot but you might be able to add it to .xinitrc that will execute when X starts the desktop. You can also put it in .bashrc but that will require a terminal window be opened to execute it. Also in Arch Linux menu Preferences, you can configure the Default applications for LXSession then click on the Autostart button to add a manually started app (which is same as editing the ../LXDE/autostart file).