| ## An Introduction
## Rob Garrett <>
We are going to start looking at the various files in the /etc
directory in order to learn how to manually configure FreeBSD. Most
of you know that I am running -CURRENT here, so there may be a few
small differences on your machine. Where I am aware of those, I will
try to point it out.
I thought we would start this series by taking a look at the boot
process to help us understand how FreeBSD goes about kicking itself
alive. But first, let me give you the grand tour of where you can
find the magic rc.* files that configure your system each time you
The first place the machine looks for a configuration file is in
/boot. This file for a short time was called boot.conf. It has now
been renamed boot.rc. Also you might have a few other files in this
directory if you are using the graphical startup interface (splash
The next place the system looks is in /etc. This is where all of the
base system configuration takes place. There are quite a few files in
/etc, and they all control how some part of FreeBSD initializes
After it reads the basic system initialization files, it then looks in
a series of configurable directories for more rc files. This can
include, but is not limited to /usr/local/etc and /usr/X11R6/lib/X11/etc.
Well thats it for the nickel tour of the rc directories, so lets get
back to what happens from when you turn the power switch on to a
running stable UNIX environment.
In 3.0+, we use a 3 stage boot process. This allows us to configure
the kernel and a few startup options before the kernel is actually
started. The configuration file in /boot boot.rc is loaded. This
actually loads all the kernel modules, splash screens, sets the root
device, and loads the kernel itself. The defaults for boot.rc are
built into the loader, so you might not initially have this file. One
of the biggest uses of boot.rc is to load the kernel.conf file that is
created by the visual configuration screen. Currently, this is not
done automatically as it was in 2.2.* Instructions to do this will be
in next month's issue of The FreeBSD 'zine.
The next thing that happens, is the kernel itself is started and it
probes for various devices. Then, using the values stored in
/etc/fstab, the system runs fsck -p for every filesystem that is about
to be mounted to test the validity of the filesystem and fix any minor
problems that it might encounter.
Next, /etc/defaults/rc.conf is read. This sets up the default system
initialization values, and in turn calls /etc/rc.conf so that you can
override the defaults. This is the reason that we recommend that you
edit /etc/rc.conf instead of changing /etc/defaults/rc.conf.
rc.conf controls what happens from here. It loads rc.i386 which goes
about setting up the values specified in rc.conf. rc.network sets up
the network stuff, rc.firewall sets up the firewall, and so on.
After this process is complete, the system looks in the directories
mentioned in rc.conf for any other configuration files you might have.
The most common place it looks is /usr/local/etc and
/usr/local/etc/rc.d, which is where apache and possibly many other
things are started if you have them configured.
It also looks in /usr/X11R6/lib/X11/etc for setup information for XDM
which is the graphical login program for X.
Finally, it leaves us with the wonderful Login: prompt we have all
grown to know and love.
Well, that's the basic tour. Next month, we will cover /etc/boot.rc
Return to Issue #5