The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
/etc/rc.conf changes for 3.1 6 March 1999
Need more help on this topic? Click here
This article has no comments
Show me similar articles
This atricle talks about /etc/rc.conf and how it has changed under 3.1 (well, it may well have changed under 3.0, but I've never used 3.0).
/etc/defaults
The first thing you should know is that /etc/defaults/rc.conf contains all the new stuff you will want to use.  But you should not modify this file.  You should put anything you wish to change in /etc/rc.conf.  Here's an extract from the top of /etc/defaults/rc.conf:
# This is rc.conf - a file full of useful variables that you can set
# to change the default startup behavior of your system.  You should
# not edit this file!  Put any overrides into one of the 
# ${rc_conf_files} instead and you will be able to update these 
# defaultslater without spamming your local configuration information.

And a little later on you find out what those files actually are:

rc_conf_files="/etc/rc.conf /etc/rc.conf.local"

This means that /etc/rc.conf now contains only those things which are different on your system from the defaults specified in /etc/defaults/rc.conf.   I think this is a much better way of doing things.  If you want to help someone out, you can instantly see what you have changed on your system because it's all in one place!

restoring /etc/defaults
Let's say you did what I did and you modified /etc/defaults/rc.conf.   All I did was fetch a new copy from the FreeBSD CVS Repository.  You can find rc.conf at http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/defaults/rc.conf by clicking on the version you want.  Remember to store away your working copy of rc.conf before you do this! Let's assume you copy it to /etc/defaults/rc.conf.modified

Then run diff on the two files and look at the output.  Perhaps something like this:

diff /etc/defaults/rc.conf /etc/defaults/rc.conf.modified > diffs.log

diffs.log will now contain the differences between these two files.  I cut and paste the differences to hand into /etc/rc.conf.  Here's my /etc/rc.conf (all IP addresses are fake):

hostname="www.example.org"

firewall_type="simple"          # Firewall type (see /etc/rc.firewall)

network_interfaces="ed0 ed1 lo0"
ifconfig_ed1="inet 192.168.0.89  netmask 255.255.255.0"

inetd_flags="-l -R 1024"      # Optional flags to inetd.
named_enable="YES"            # Run named, the DNS server (or NO).
named_program="/usr/sbin/named"
named_flags="-b /etc/named.conf"

nfs_client_enable="YES"       # This host is an NFS client (or NO).
nfs_server_enable="YES"       # This host is an NFS server (or NO).
nfs_server_flags="-u -t 4"    # Flags to nfsd (if enabled).

xntpd_flags="-c /etc/ntp.conf -p /var/run/xntpd.pid" 
tickadj_enable="NO"           # Run tickadj (or NO).
tickadj_flags="-Aq"           # Flags to tickadj (if enabled).

gateway_enable="YES"   # Set to YES if this host will be a gateway.

natd_enable="YES"
natd_interface="ed0"
natd_flags="-f /etc/natd.conf"

Need more help on this topic? Click here
This article has no comments
Show me similar articles