Skip to content

Independent notes on FreeBSD · published since 1999

The FreeBSD 'zine Features, news and community notes for FreeBSD

Issue 6 · July 2000

Reader written notes on FreeBSD, from the command line to the server room.

Open the current issue

June 1999 · Featured article

/etc

An Introduction

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 start it.

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 screen).

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 itself.

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 in detail.

Rob

On the web

Further reading from the FreeBSD community and the projects named in this article.

Issue contents

Issue 5/6 · Jun 1999

Crontab

An Introduction

By Eric De La Cruz Lugo

What??? It�s 5:00 PM! You have a date with someone very important at 5:15 PM! Before you go, you have several things to do; send e mail to 20...

Read the article

Issue 5/6 · Jun 1999

Samba

An Introduction

By Daniel Jung

This article is written in two parts. First, introduction to samba. The second one is on smb.conf parameters. What is Samba? Samba is a program that...

Read the article

Issue 5/6 · Jun 1999

Samba

Setting up smb.conf

By Daniel Jung

Now you know how to start samba , but before you actually start the samba daemons you need to set up smb.conf. We need smb.conf (man 5 smb.conf)...

Read the article