Опубликован: 06.08.2012 | Доступ: свободный | Студентов: 1327 / 46 | Оценка: 5.00 / 5.00 | Длительность: 53:41:00
Лекция 30:

FreeBSD configuration File

Files you should not change

The files in the following section are there as a kind of reference information. Normally you should not change them, though there might be exceptional circumstances where it makes sense to change them.


/etc/gettytab describes profiles for getty. You probably don't need it; check the man page if you're interested.


/etc/manpath.config is a configuration file for man. You don't usually need to change this file.


/etc/netconfig is new in FreeBSD Release 5. It is similar to the file of the same name in UNIX System V, but it's only used for C library RPC code. In general, you don't need to worry about this file unless you're upgrading from an older release of FreeBSD. If it's not here, a number of network functions, including NFS, will not work.


/etc/networks was once a list of networks in the Internet. Although this sounds like a good idea, it is almost useless: if you connect to the Internet, you should use a name server, which supplants this file.


/etc/passwd is the old-style password file. It is now present only for programs that expect to read user information from it, and it no longer contains passwords. Don't change this file; the programs vipw, adduser and pwd_mkdb do it automatically. See page 144 for more details.


/etc/protocols is a list of known protocols that run on the IP layer. Consider this file to be read-only.


/etc/pwd.db is a machine-readable form of the user database with the passwords removed. We looked at it on page 144. Like /etc/passwd, it is generated automatically.


/etc/rc is the main script that starts up the system. It uses the other files whose names start with /etc/rc to perform specific initialization. See page 528 for more details.


/etc/rc.i386 is used to initialize features specific to the Intel 386 architecture, such as SCO and Linux emulation. You don't normally need to look at or change this file.

/etc/rc.network and /etc/rc.network6

The main scripts for starting the network are /etc/rc.network, which in earlier FreeBSD releases was called /etc/network, and /etc/rc.network6, which starts IPv6 services. You normally don't change these files: they read all the necessary definitions from /etc/rc.conf, and that's the file you should change.


/etc/rc.pccard sets up laptops using the PC Card bus.


/etc/rc.serial sets default values for serial devices.


/etc/shells is a list of valid shells, used by ftp and some other programs. ftpd refuses to open a session for a user whose shell is not mentioned in this file. This prevents people from starting an ftp session as a daemon, which frequently have no passwords. chpass will not let you change your shell to a shell not included in this file. See page 452 for more details. It is usually updated when you install a new shell from the Ports Collection.


/etc/services contains a list of the IP services that this system supports.


/etc/spwd.db is a machine-readable form of the user database with the passwords intact. We looked at it on page 144.


/etc/termcap (terminal capabilities) describes terminal control sequences. By default, programs use the value of the TERM environment variable to look up the terminal capabilities in this database. See page 128 for more details.


The directory /etc/periodic contains three directories used by cron at regular intervals: daily, weekly and monthly. The directories contain a number of files for performing specific tasks. For example, /etc/periodic/daily contains the following files:

-rwxr-xr-x  5  grog  lemis  1269  Apr  26  2001  100.clean-disks
-rwxr-xr-x  4  grog  lemis  1449  Nov  21  13:55  110.clean-tmps
-rwxr-xr-x  5  grog  lemis  1092  Sep  15  2000  120.clean-preserve
-rwxr-xr-x  5  grog  lemis   695  Sep  15  2000  130.clean-msgs
-rwxr-xr-x  5  grog  lemis  1056  Sep  15  2000  140.clean-rwho
-rwxr-xr-x  1  grog  lemis   595  Jan   9  07:11  150.clean-hoststat
-rwxr-xr-x  5  grog  lemis  1742  Nov  15  2001  200.backup-passwd
-rwxr-xr-x  5  grog  lemis   996  Sep  15  2000  210.backup-aliases
-rwxr-xr-x  5  grog  lemis   679  Sep  15  2000  300.calendar
-rwxr-xr-x  5  grog  lemis  1211  May  31  2001 310.accounting
-rwxr-xr-x  5  grog  lemis   710  Sep  15  2000  330.news
-rwxr-xr-x  5  grog  lemis   516  Jul  26  2002  400.status-disks
-rwxr-xr-x  5  grog  lemis   548  Sep  15  2000  420.status-network
-rwxr-xr-x  5  grog  lemis   687  Sep  15  2000  430.status-rwho
-rwxr-xr-x  3  grog  lemis  1362  Dec   9  07:15  440.status-mailq
-rwxr-xr-x  5  grog  lemis   768  Jul  26  2002  450.status-security
-rwxr-xr-x  3  grog  lemis  1633  Dec   9  07:15  460.status-mail-rejects
-rwxr-xr-x  1  grog  lemis  1489  Jan   7  07:10  470.status-named
-rwxr-xr-x  5  grog  lemis   723  Jul  26  2002  500.queuerun
-rwxr-xr-x  5  grog  lemis   712  Jun   2  2001  999.local

The files are executed in the order of their names, so the names consist of two parts: a number indicating the sequence, and a name indicating the function. This method is new with FreeBSD Release 3. In older releases of FreeBSD, these functions were performed by files with the names /etc/daily, /etc/weekly and /etc/monthly. See page 151 for more details of cron.

Obsolete configuration files

In the course of time, a number of configuration files have come and gone. This can be tricky if you're updating a system: some old configuration files could remain and either confuse you by not working the way you expect, or cause incorrect operation by some side effect of the presence of the file.


/etc/host.conf described the order in which to perform name resolution. It has been replaced by /etc/nsswitch.conf, which has a different syntax.


Previous versions of named, the DNS daemon, used /etc/named.boot as the main configuration file. Newer versions use /etc/namedb/named.conf, and the format is very different.


/etc/netstart was a script called by /etc/rc to start up the network. Its name has now been changed to /etc/rc.network. FreeBSD still includes a file /etc/netstart, but its only purpose is to start the network in single-user mode.


/etc/sysconfig was a file that contained all the site-specific configuration definitions. Its name has been changed to /etc/rc.conf.