old-www/LDP/LG/issue32/tag_startup.html

206 lines
8.0 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head>
<META NAME="generator" CONTENT="lgazmail v1.1preB">
<TITLE>The Answer Guy 32:
Where to put 'insmod' and 'modprobe' Commands for Start-up
</TITLE>
<!-- ORIGINAL SUBJECT:
Linux System Administration.
JTD SUBTITLE:
-->
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H1 align="center"><A NAME="answer">
<img src="../gx/dennis/qbubble.gif" alt="" border="0" align="middle">
<a href="./index.html">The Answer Guy</a>
<img src="../gx/dennis/bbubble.gif" alt="" border="0" align="middle">
</A></H1>
<BR>
<H4 align="center">By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a>
<BR>Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H4>
<p><hr><p>
<!--endcut ========================================================= -->
<H3><img src="../gx/dennis/qbub.gif" alt="(?)"
width="50" height="28" align="left" border="0"
>Where to put 'insmod' and 'modprobe' Commands for Start-up</H3>
<p><strong>From <em>anonymous</em> on 14 Aug 1998 </strong></p>
<!-- begin body -->
<strong><p>If it entertains you, a couple of questions:
</p></strong>
<strong><p>Where the bleep should one specify modules to be installed when a
system boots? I can't find it stated directly in any of the books,
maybe <tt>/lib/modules/default</tt> ?
</p></strong>
<blockquote><img src="../gx/dennis/bbub.gif" height="28" width="50"
alt="(!)" border="0"
>There are three ways to do this.
</blockquote>
<blockquote>The simplest is to load and unload the modules as you need
them (thus you find your first 'ifconfig' command and
insert an '<tt>insmod</tt>' or a '<tt>modprobe</tt>' command for your ethernet
card before it; you change your ppp startup script to load
the ppp module, etc).
</blockquote>
<blockquote>Another way is to put all of you '<tt>modprobe</tt>' or '<tt>insmod</tt>'
commands in some file like <tt>/etc/rc.d/init.d/modules</tt> and
call that from one of your early rc scripts. You can trace
through these rc script by starting with the inittab which
generally has a set of references like:
</blockquote>
<pre># /etc/inittab
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l6:6:wait:/etc/rc.d/rc 6
</pre>
<blockquote>... all of these call the <tt>/etc/rc.d/rc</tt> script -- with
a parameter to specify the runlevel, of course.
</blockquote>
<blockquote>So you look in that script and insert a call to your
<tt>/etc/rc.d/init.d/modules</tt> in the appropriate block <EM>or</EM>
you put a set of symlinks under each of the <tt>rcX.d/</tt>
directories that correspond to each of the runlevels where
you want these modules loaded. You'll want to prefix
any of those symlink names with the <tt>SXX</tt> --- using a low
number like <tt>S01modules</tt> --- to make sure that the "<tt>modules</tt>"
script is called very early in the boot process, before
anything that depends on them is called.
</blockquote>
<blockquote>The difference between '<tt>insmod</tt>' and '<tt>modprobe</tt>' is that
'<tt>insmod</tt>' is a somewhat simpler program. You usually have
to specify a full path with it -- and you much load modules
in the correct order. '<tt>modprobe</tt>' relies an a modules
dependency tree to find and load the specified module *and
any that it requires*. To prepare the dependency tree you
must run '<tt>depmod -a</tt>' at least once after building and
installing any new kernel or modules. Some distributions
will run a '<tt>depmod -a</tt>' command as part of the normal
startup sequence.
</blockquote>
<blockquote>Yet another way, ultimately the one that is most
convenient, is to run <tt>kerneld</tt> (2.0.x) or <tt>kmod</tt> (2.1.x and
eventually 2.2). These kernel module loaders will dynamically
load and unload modules and their dependents. This is
similar to the way that Solaris does it (although it doesn't
seem to be optional under Solaris).
</blockquote>
<strong><p><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
>The "multiple configuations" thing in linuxconf
(control-panel/system) seems to be reasonably broken; are you
writing about any of this?
</p></strong>
<blockquote><img src="../gx/dennis/bbub.gif" height="28" width="50"
alt="(!)" border="0"
>I played with linuxconf only briefly. It seemed like
it was often trying to do "too much" and I'd've preferred
a mode where I could just use it to spit out configuration
files and instructions on where I should put them.
</blockquote>
<strong><p><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
>Boy does the world need your book; the docs that are there seem
pretty hopeless...
</p></strong>
<blockquote><img src="../gx/dennis/bbub.gif" height="28" width="50"
alt="(!)" border="0"
>They can be frustrating. I try to help because I figure
I've beat my head against that wall enough for any ten
people.
</blockquote>
<!-- end body -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1998, James T. Dennis <BR>
Published in <I>Linux Gazette</I> Issue 32 September 1998</H5>
<P> <hr> <P>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<table width="98%"><tr valign="center" align="center">
<td rowspan="3"><A HREF="./lg_answer32.html"><IMG
SRC="../gx/dennis/answernew.gif"
ALT="[ Answer Guy Index ]"></A></td>
<td><A HREF="tag_phreak.html">phreak</A>
<td><A HREF="tag_abandon.html">abandon</A>
<td><A HREF="tag_javaterm.html">javaterm</A>
<td><A HREF="tag_BBS.html">BBS</A>
<td><A HREF="tag_flaws.html">flaws</A>
<td><A HREF="tag_doslinux.html">doslinux</A>
<td><A HREF="tag_resume.html">resume</A>
</tr><tr valign="center" align="center">
<td><A HREF="tag_softwindows.html">softwindows</A>
<td><A HREF="tag_convert.html">convert</A>
<td><A HREF="tag_apache.html">apache</A>
<td><A HREF="tag_emulate.html">emulate</A>
<td><A HREF="tag_database.html">database</A>
<td><A HREF="tag_distrib.html">distrib</A>
<td><A HREF="tag_proxy.html">proxy</A>
</tr><tr valign="center" align="center">
<td><A HREF="tag_disable.html">disable</A>
<td><A HREF="tag_DVI.html">DVI</A>
<td><A HREF="tag_superblock.html">superblock</A>
<td><A HREF="tag_serial.html">serial</A>
<td><A HREF="tag_permission.html">permission</A>
<td><A HREF="tag_detach.html">detach</A>
<td><A HREF="tag_cdr.html">cdr</A>
</tr><tr valign="center" align="center">
<td><A HREF="tag_rs422.html">rs422</A>
<td><A HREF="tag_modem.html">modem</A>
<td><A HREF="tag_notfound.html">notfound</A>
<td><A HREF="tag_tuning.html">tuning</A>
<td><A HREF="tag_libc5.html">libc5</A>
<td><A HREF="tag_startup.html">startup</A>
<td><A HREF="tag_clock.html">clock</A>
<td><A HREF="tag_ping.html">ping</A>
</tr><tr valign="center" align="center">
<td><A HREF="tag_accounts.html">accounts</A>
<td><A HREF="tag_lilo.html">lilo</A>
<td><A HREF="tag_NDS.html">NDS</A>
<td><A HREF="tag_95slow.html">95slow</A>
<td><A HREF="tag_nonlinux.html">nonlinux</A>
<td><A HREF="tag_progenv.html">progenv</A>
<td><A HREF="tag_cluster.html">cluster</A>
<td><A HREF="tag_ftpd.html">ftpd</A>
</tr></table>
<P> <hr> <P>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif"
ALT="[ Table Of Contents ]"></A>
<A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
ALT="[ Front Page ]"></A>
<A HREF="lg_bytes32.html"><IMG SRC="../gx/back2.gif"
ALT="[ Previous Section ]"></A>
<A HREF="./stemen.html"><IMG SRC="../gx/fwd.gif"
ALT="[ Next Section ]"></A>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</body>
</html>
<!--endcut ========================================================= -->