Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4587  / 2 Years ago, fri, august 26, 2022, 10:15:29

I am automating some configurations on my systems using Puppet (however, that is not really relevant here). For a group of machines I want to load a kernel module at boot time. The most elegant way seems to edit /etc/modules and add one on an individual line. However, I would like to use separate files in a ".d" directory structure for easier maintainability, rather than having Puppet editing a file.



For modprobe and specifying the options for or blacklisting modules, there's /etc/modprobe.d/, but what's the most elegant way for actually loading modules at boot time using a single new file? Basically, I'm looking for the non-existing /etc/modules.d/ directory.



Any suggestions?


More From » boot

 Answers
1

The directory you are looking for is



/etc/modules-load.d


For example, to always load the nf_conntrack_pptp kernel module, add nf_conntrack_pptp to /etc/modules-load.d/pptp.conf. The filename doesn't matter, but I'm guessing the convention or requirement is that it ends in .conf.



This is implemented for older Ubuntu versions (without systemd) using a SysVinit script in /etc/init.d/kmod. For newer systemd-versions (15.04+), systemd handles this. Read the documentation man 5 modules-load.d.


[#33726] Friday, August 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eatack

Total Points: 245
Total Questions: 120
Total Answers: 113

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;