[CLUE-Tech] module loading question

David Anselmi anselmi at americanisp.net
Wed Mar 26 16:21:06 MST 2003


Jeremiah Stanley wrote:
[...]
> 
> That seemed to do the trick. Now when iptables gets run it'll load the
> module and with the below lines in /etc/modules.conf:
> 
> above ip_tables ip_conntrack
> above ip_conntrack ip_conntrack_ftp

You shouldn't need the first of these.  ip_conntrack should be loaded 
automatically when you run "iptables ... -m state --state ...".  Just 
like you don't need to modprobe ip_tables -- it is loaded automatically 
the first time you use an iptables command.

> Now, all the modules get loaded on boot or after iptables get run. I'm
> happy!
> 
> Sadly enough, RH 7.3 doesn't load the modules in modules.conf if you
> just list them there. Putting that line there made the machine barf on
> module loading (so the ethernet module didn't get loaded, bad mojo).

No system loads modules based on modules.conf.  That file just tells 
modprobe how to behave (just like httpd.conf tells apache how to behave 
but doesn't start apache).  If you want modules to load at boot, one of 
the init scripts has to modprobe it.  Debian gives you a specific way to 
do that (/etc/modules and init.d/modutils), probably RH does too 
(rc.local? but that isn't as single purpose).

What happens is that the kernel loads modules when it needs them.  So if 
you mount an ext3 filesystem, the kernel knows to load the ext3 module 
first.  For many devices the kernel knows what to do and it Just 
Works(tm).  Iptables is one of those (except for the ftp piece).

Network drivers are an example where things aren't automatic.  You put a 
line that says "alias eth0 8139too" in modules.conf and now the kernel 
knows (modprobe knows?) that when you ifconfig eth0 it needs the 8139 
driver.  I don't know the details about why filesystem drivers and 
ethernet drivers are different, but they are.

> Thanks for the clarification Dave, that link in the other email was of
> "eye opener" quality.

Thanks for letting us know it worked.

Dave




More information about the clue-tech mailing list