|
Posted by Michael Trausch on 10/03/65 11:25
Spare Brain wrote:
>
> 1. Why would the install place the apache2 and mysql scripts under the
> /etc/init.d but not have any entries in any of the rc scripts?
>
As others have already answered #2, I'll try to answer #1 for you as
best as I can.
Different installations require different things. There are quite a few
ways to have your /sbin/init (or even /etc/init on older systems!)
configured to allow new packages to run. Mostly, there is the BSD way
of doing things, and the AT&T way of doing things. However, I never
remember which is which, because many Linux distributions emulate one or
the other, or both.
In one version, you can use /etc/rc.d/script_name_here and those scripts
are directly run at startup and shutdown, with varying parameters, and
some scripts take more then just the default "start" and "stop". For
example, for Apache and MySQL on my system, the following is run by my
startup scripts when I boot up:
/etc/rc.d/rc.mysql start
/etc/rc.d/rc.httpd start
In the other one, however, you have the complex structure of symlinks
that begin with S* and K*, located in different directories which
signify the runlevel (e.g., /etc/rc.2 for runlevel two). This yields a
slightly more flexible configuration, however, it also can lead to
disaster if you forget to add something to more then one runlevel if
needed, or if you put things in that you should... essentially it adds
more points of failure to the init system. It depends on shell globbing
features for it to work, for starters, and it also depends on the
administrator wanting to spend the time to really tweak the system.
This is good if you use actually use different runlevels for something
useful; for example, Runlevel 2 is multi-user, and Runlevel 3 is more of
a high-load multi-user, or, in the case of a testing box, you can use
runlevels to switch from a set of production/stable servers, to a set of
testing/unstable/development servers that you're trying to work on,
debug, whatever. Largely enough, though, it's a PITA.
Slackware Linux, FWIW, provides the former behavior by default, and
impelements the latter using a shell script to emulate the full
functionality. This should be used with caution, however, as it's not
perfect. I am not sure how SuSE does things, but I'm sure that it can
probably be configured to do either/or, since you can have one script
that is linked to, managing a /etc/rc.d/rc.* configuration similar to
what is native (and, simpler) in many systems. For the most part, in
systems that are "live," and use the former configuration that I
mentioned, they will run those scripts for all runlevels except for 0,
1, and 6, assuming that on your system you're not using a terribly
heavily customized configuration: These runlevels typically represent
halt, single-user mode, and reboot, respectively.
HTH,
Michael
[Back to original message]
|