copyediting for Usenix manuals
[unix-history] / usr / src / share / man / man8 / rc.8
CommitLineData
7b766c04
KB
1.\" Copyright (c) 1980, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3f4c195c 3.\"
b42074ab 4.\" %sccs.include.redist.man%
3f4c195c 5.\"
653ba8b6 6.\" @(#)rc.8 8.2 (Berkeley) %G%
b42074ab
CL
7.\"
8.Dd
9.Dt RC 8
10.Os BSD 4
11.Sh NAME
12.Nm rc
13.Nd command script for auto\-reboot and daemons
14.Sh SYNOPSIS
15.Nm rc
16.Nm rc.local
17.Sh DESCRIPTION
18.Nm Rc
2951b510 19is the command script which controls the automatic reboot and
b42074ab 20.Nm rc.local
2951b510
KM
21is the script holding commands which are pertinent only
22to a specific site.
b42074ab 23.Pp
3f4c195c 24When an automatic reboot is in progress,
b42074ab 25.Nm rc
3f4c195c 26is invoked with the argument
b42074ab
CL
27.Em autoboot .
28The first portion of
29.Nm rc
30runs an
31.Xr fsck 8
3f4c195c 32with option
b42074ab 33.Fl p
3f4c195c
KM
34to ``preen'' all the disks of minor inconsistencies resulting
35from the last system shutdown and to check for serious inconsistencies
36caused by hardware or software failure.
37If this auto-check and repair succeeds, then the second part of
b42074ab 38.Nm rc
3f4c195c 39is run.
b42074ab 40.Pp
3f4c195c 41The second part of
b42074ab 42.Nm rc ,
653ba8b6 43which is run after an auto-reboot succeeds and also if
b42074ab 44.Nm rc
3f4c195c 45is invoked when a single user shell terminates (see
b42074ab 46.Xr init 8 ) ,
3f4c195c
KM
47starts all the daemons on the system, preserves editor files
48and clears the scratch directory
b42074ab
CL
49.Pa /tmp .
50.Pp
51.Nm Rc.local
2951b510 52is executed immediately before any other commands after a successful
b42074ab 53.Xr fsck .
2951b510 54Normally, the first commands placed in the
b42074ab 55.Nm rc.local
2951b510 56file define the machine's name, using
b42074ab 57.Xr hostname 1 ,
2951b510 58and save any possible core image that might have been
b42074ab
CL
59generated as a result of a system crash, with
60.Xr savecore 8 .
2951b510 61The latter command is included in the
b42074ab 62.Nm rc.local
2951b510
KM
63file because the directory in which core dumps are saved
64is usually site specific.
b42074ab
CL
65.Pp
66Following tradition, the startup files
67.Nm rc
68and
69.Nm rc.local
70reside in
71.Pa /etc .
72.Sh SEE ALSO
73.Xr init 8 ,
74.Xr reboot 8 ,
75.Xr savecore 8
76.Sh HISTORY
77The
78.Nm
79command appeared in
80.Bx 4.0 .