I have been breaking my head over this the last few hours. On one of my machines the intel-rapl-msr
driver is buggy and reloading it fixes the issue. I thought I could trivially create a service that does this on boot. But I can't get the service to load after the driver has loaded.
[Unit]
Description=Reload intel-rapl-msr
Requires=systemd-modules-load.target
WantedBy=multi-user.target
ExecStart=/nix/store/wqjkhyyffqdbx767vlqklzi12ln8j3pv-unit-script-cpu-script-start/bin/cpu-script-start
Where the script in ExecStart
simply contains:
rmmod intel_rapl_msr
modprobe intel_rapl_msr
This way the service fails on boot with the message:
mmod: ERROR: Module intel_rapl_msr is not currently loaded
So is it possible to force a service to run after this kernel module is loaded?
Any help is appreciated!