xref: /freebsd/share/man/man8/rc.8 (revision a8445737e740901f5f2c8d24c12ef7fc8b00134e)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)rc.8	8.2 (Berkeley) 12/11/93
33.\"	$Id: rc.8,v 1.3 1997/03/07 03:28:21 jmg Exp $
34.\"
35.Dd December 11, 1993
36.Dt RC 8
37.Os BSD 4
38.Sh NAME
39.Nm rc
40.Nd command scripts for auto\-reboot and daemon startup
41.Sh SYNOPSIS
42.Nm rc
43.Nm rc.conf
44.Nm rc.conf.local
45.Nm rc.serial
46.Nm rc.pccard
47.Nm rc.network
48.Nm rc.firewall
49.Nm rc.<arch>
50.Nm rc.local
51.Nm rc.shutdown
52.Sh DESCRIPTION
53.Nm Rc
54is the command script which controls the automatic reboot
55(calling the other scripts) and
56.Nm rc.local
57is the script holding commands which are pertinent only
58to a specific site.
59.Nm Rc.conf
60contains the global system configuration information referenced
61by the rc files, while
62.Nm rc.conf.local
63contains the local system configuration.
64.Pp
65.Nm Rc.shutdown
66is the command script which contains any necessary commands
67to be executed as the system is shut down.
68.Pp
69When an automatic reboot is in progress,
70.Nm rc
71is invoked with the argument
72.Em autoboot .
73The first portion of
74.Nm rc
75runs an
76.Xr fsck 8
77with option
78.Fl p
79to ``preen'' all the disks of minor inconsistencies resulting
80from the last system shutdown and to check for serious inconsistencies
81caused by hardware or software failure.
82If this auto-check and repair succeeds, then the second part of
83.Nm rc
84is run.
85.Pp
86The second part of
87.Nm rc ,
88which is run after an auto-reboot succeeds and also if
89.Nm rc
90is invoked when a single user shell terminates (see
91.Xr init 8 ) ,
92starts all the daemons on the system, preserves editor files
93and clears the scratch directory
94.Pa /tmp .
95.Pp
96.Nm Rc.serial
97is used to set any special configurations for serial devices.
98.Pp
99.Nm Rc.pccard
100is used to enable PC-cards.
101.Pp
102.Nm Rc.network
103is used to start the network.
104The network is started in three passes.
105The first pass sets the hostname and domainname, configures the network
106interfaces, turns on any IP firewall rules, and starts routing.
107The second pass starts most of the network related daemons.
108The third pass starts NFS, amd, rwhod, Kerberos and
109the multicast routing daemon.
110.Pp
111.Nm Rc.firewall
112is used to configure rules for the kernel based firewall
113service. It has several possible options:
114.Pp
115.Bl -tag -width "fBfilename" -compact -offset indent
116.It open
117will allow anyone in.
118.It client
119will try to protect just this machine.
120.It simple
121will try to protect a whole network.
122.It closed
123totally disables IP services except via lo0 interface.
124.It UNKNOWN
125disables the loading of firewall rules.
126.It filename
127will load the rules in the given filename (full path required).
128.El
129.Pp
130.Nm Rc.<arch>
131runs architecture specific programs.
132.Pp
133.Nm Rc.local
134is executed after the scripts above, but before the rest of the
135.Nm rc
136file is completed.
137Presently, all
138.Nm rc.local
139does is to put version information in
140.Pa /etc/motd .
141.Pp
142Following tradition, the startup files reside in
143.Pa /etc .
144.Sh SEE ALSO
145.Xr rc.conf 5 ,
146.Xr init 8 ,
147.Xr reboot 8 ,
148.Xr savecore 8
149.Sh HISTORY
150The
151.Nm
152command appeared in
153.Bx 4.0 .
154