[PLUG] Probing init scripts...

Felix Lee felix.1 at canids.net
Tue Aug 26 23:53:02 UTC 2003


"Michael C. Robinson" <michael at goose.robinson-west.com>:
> I've written a series of  bash script for selecting network boot
> images.  I have a book on bash, but I'm running into a
> lot of syntax I don't recognize

It's all described in the bash man page.  The man page is not
that long.

> and more than that I wish there 
> were some notes on what these init scripts were written to do
> in more detail than I currently have.  I can pick out some 
> blocks of code and see some of the logical organization, but 
> it's slow going.

Start from the top.  Everything starts from the program 'init'.
init runs the programs specified in /etc/inittab.  /etc/inittab
says to run /etc/rc.d/rc.  /etc/rc.d/rc does a bunch of stuff,
which includes running the scripts in /etc/rc.d/rc?.d, which are
symlinks to scripts in /etc/rc.d/init.d.  It's pretty
straightforward, there's nothing magic going on.

> One thing 
> I don't get is why the files under etc for the large part 
> aren't connected to the package their respective programs 
> are installed from.

It's partly historical, partly practical.  One motivation is to
separate sharable data from non-sharable data.  In principle, it
should be possible to have thousands of systems with identical
read-only copies of most of the filesystem.  See the Filesystem
Hierarchy Standard for more detail.

> Another thing I don't get is why Redhat 
> has a predefined password list instead of having a package 
> add users and groups for itself when it is installed?

Because you run into problems if uids are mismatched, especially
across NFS.  It's better to reserve all the important uids in
advance, so nobody accidentally uses the same uid for 'guest' and
'apache', for instance.

Someone else can answer the rest.
--




More information about the PLUG mailing list