You are not logged in.

#1 2014-02-09 22:19:17

marco1475
Member
From: Baltimore, MD, USA
Registered: 2013-10-20
Posts: 4

[SOLVED] Loading Kernel Modules with Options

Hi,

I am trying to load the nf_conntrack_ftp kernel module on boot. I followed the Arch Wiki's article on kernel module loading [0] and created a file in /etc/modules-load.d/ called nf_conntrack_ftp.conf:

/etc/modules-load.d/nf_conntrack_ftp.conf wrote:

# Load the nf_conntrack_ftp kernel module at boot
nf_conntrack_ftp

This loads the nf_conntrack_ftp module on boot just fine; unfortunately the module uses the default FTP port (21) and I need it to run on a different port (6621). When I try to dynamically load nf_conntrack_ftp using modprobe nf_conntrack_ftp ports=6621 it loads just fine and according to systools has the port set correctly. However, if I try to set the port anywhere in /etc/modules-load.d/ I always get an error message during boot saying:

Failed to start Load Kernel Modules. See 'systemctl status systemd-modules-load.service' for details.

Looking at the systemctl status message as recommended by the error message on boot doesn't yield anything useful:

systemctl status systemd-modules-load.service wrote:

systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
   Active: failed (Result: exit-code) since Sun 2014-02-09 16:46:13 EST; 11min ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 287 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
Main PID: 287 (code=exited, status=1/FAILURE)

Feb 09 16:46:13 babylon5 systemd[1]: systemd-modules-load.service: main process exited, code=exited, status=1/FAILURE
Feb 09 16:46:13 babylon5 systemd[1]: Failed to start Load Kernel Modules.
Feb 09 16:46:13 babylon5 systemd[1]: Unit systemd-modules-load.service entered failed state.

I have tried to set the "ports=6621" module option in multiple ways ...

1. As part of the same nf_conntrack_ftp.conf file in /etc/modules-load.d/:

/etc/modules-load.d/nf_conntrack_ftp.conf wrote:

# Load the nf_conntrack_ftp kernel module at boot
nf_conntrack_ftp

options nf_conntrack_ftp ports=6621

2. As a separate test.conf file in /etc/modules-load.d/:

/etc/modules-load.d/nf_conntrack_ftp.conf wrote:

# Load the nf_conntrack_ftp kernel module at boot
nf_conntrack_ftp

/etc/modules-load.d/test.conf wrote:

options nf_conntrack_ftp ports=6621

3. I even tried just adding "ports=6621" to the end of the nf_conntrack_ftp.conf file in /etc/modules-load.d/:

/etc/modules-load.d/nf_conntrack_ftp.conf wrote:

# Load the nf_conntrack_ftp kernel module at boot
nf_conntrack_ftp ports=6621

None of these worked. The moment there is "options nf_conntrack_ftp ports=6621" in any file in /etc/modules-load.d/ I get the error message on boot and the kernel module won't get loaded.

What am I missing / doing wrong? Is it not possible to set kernel module parameters on boot? Does nf_conntrack_ftp need to be loaded by the initramfs, i.e. do I need to add the modconf hook to my /etc/mkinitcpio.conf?

Thanks,
Marek

[0] https://wiki.archlinux.org/index.php/Kernel_modules

Last edited by marco1475 (2014-02-09 22:54:26)

Offline

#2 2014-02-09 22:31:40

Raynman
Member
Registered: 2011-10-22
Posts: 1,256

Re: [SOLVED] Loading Kernel Modules with Options

Read this again, specifically the section about setting options, paying close attention to directory names.

Offline

#3 2014-02-09 22:54:02

marco1475
Member
From: Baltimore, MD, USA
Registered: 2013-10-20
Posts: 4

Re: [SOLVED] Loading Kernel Modules with Options

Raynman wrote:

Read this again, specifically the section about setting options, paying close attention to directory names.

D'oh! Thanks for pointing that out, what a stupid oversight on my part:

The files that tell the system which kernel modules to load go into /etc/modules-load.d/.
The files that tell the system which parameters to pass to the kernel modules when loading them go into /etc/modprobe.d/.

Now that each file is where it belongs everything works.

Offline

Board footer

Powered by FluxBB