Gentoo Archives: gentoo-dev

From: "Craig M. Reece" <craigthulu@×××××××××.net>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Loading Modules from Init Scripts?
Date: Fri, 25 Jan 2002 16:44:23
Message-Id: 20020125224305.22F1453C52@craigthulu.com
In Reply to: [gentoo-dev] Loading Modules from Init Scripts? by "Chad M. Huneycutt"
1 On Friday 25 January 2002 05:31 pm, Chad M. Huneycutt wrote thusly:
2 > Hi all,
3 > Do we have a policy about init scripts loading modules? I didn't think
4 > the scripts for any packages that I have installed load modules, but I
5 > don't have everything installed. It seems like the preferred way to do it
6 > is to have the admin put any necessary modules in /etc/modules.autoload.
7 >
8
9 My impression is that /etc/modules.autoload is used for modules that you
10 _always_ want loaded. Thus, the init script should load its own needed stuff
11 since we would then be assuming that the script is not _always_ run.
12
13 > Here is why I ask. The pcmcia init script that is installed with
14 > pcmcia-cs currently is outdated, but it loads the $PCIC (i82365 or
15 > yenta_socket) module, as well as pcmcia_core and ds. Then it starts
16 > cardmgr (which will not start without ds loaded). The init script does not
17 > unload the modules when it is stopped, though.
18 >
19 > It makes sense that if a service requires particular kernel
20 > functionality to be available in order to work that it should load the
21 > modules for that functionality. However, this adds some overhead to the
22 > initscript, in that you have to determine if the module exists, load it,
23 > make sure it loads, etc. before starting the service. Then what about when
24 > the functionality has been built into the kernel, not as a module. Do we
25 > have to detect that? That is why I think it might be easier if we make it
26 > policy to just eerror out and say "You have to first load these modules!"
27 > rather than worrying about loading them in the script.
28 >
29 > If we decide to load modules from the scripts, then it would be nice to
30 > have some convenience routines to facilitate the process, e.g.,
31 >
32 > load_modules pcmcia_core i82365 ds || die
33 >
34 > or something like that, which would check to see if the modules were
35 > already loaded (or maybe even compiled into the kernel), and if not, then
36 > it would load them.
37 >
38 > Thoughts?
39 >
40
41 I like this method a lot better than the way the pcmcia-cs package's default
42 init goes about doing things.