Commit | Line | Data |
---|---|---|
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 | 19 | is the command script which controls the automatic reboot and |
b42074ab | 20 | .Nm rc.local |
2951b510 KM |
21 | is the script holding commands which are pertinent only |
22 | to a specific site. | |
b42074ab | 23 | .Pp |
3f4c195c | 24 | When an automatic reboot is in progress, |
b42074ab | 25 | .Nm rc |
3f4c195c | 26 | is invoked with the argument |
b42074ab CL |
27 | .Em autoboot . |
28 | The first portion of | |
29 | .Nm rc | |
30 | runs an | |
31 | .Xr fsck 8 | |
3f4c195c | 32 | with option |
b42074ab | 33 | .Fl p |
3f4c195c KM |
34 | to ``preen'' all the disks of minor inconsistencies resulting |
35 | from the last system shutdown and to check for serious inconsistencies | |
36 | caused by hardware or software failure. | |
37 | If this auto-check and repair succeeds, then the second part of | |
b42074ab | 38 | .Nm rc |
3f4c195c | 39 | is run. |
b42074ab | 40 | .Pp |
3f4c195c | 41 | The second part of |
b42074ab | 42 | .Nm rc , |
653ba8b6 | 43 | which is run after an auto-reboot succeeds and also if |
b42074ab | 44 | .Nm rc |
3f4c195c | 45 | is invoked when a single user shell terminates (see |
b42074ab | 46 | .Xr init 8 ) , |
3f4c195c KM |
47 | starts all the daemons on the system, preserves editor files |
48 | and clears the scratch directory | |
b42074ab CL |
49 | .Pa /tmp . |
50 | .Pp | |
51 | .Nm Rc.local | |
2951b510 | 52 | is executed immediately before any other commands after a successful |
b42074ab | 53 | .Xr fsck . |
2951b510 | 54 | Normally, the first commands placed in the |
b42074ab | 55 | .Nm rc.local |
2951b510 | 56 | file define the machine's name, using |
b42074ab | 57 | .Xr hostname 1 , |
2951b510 | 58 | and save any possible core image that might have been |
b42074ab CL |
59 | generated as a result of a system crash, with |
60 | .Xr savecore 8 . | |
2951b510 | 61 | The latter command is included in the |
b42074ab | 62 | .Nm rc.local |
2951b510 KM |
63 | file because the directory in which core dumps are saved |
64 | is usually site specific. | |
b42074ab CL |
65 | .Pp |
66 | Following tradition, the startup files | |
67 | .Nm rc | |
68 | and | |
69 | .Nm rc.local | |
70 | reside in | |
71 | .Pa /etc . | |
72 | .Sh SEE ALSO | |
73 | .Xr init 8 , | |
74 | .Xr reboot 8 , | |
75 | .Xr savecore 8 | |
76 | .Sh HISTORY | |
77 | The | |
78 | .Nm | |
79 | command appeared in | |
80 | .Bx 4.0 . |