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$ 34.\" 35.Dd December 11, 1993 36.Dt RC 8 37.Os BSD 4 38.Sh NAME 39.Nm rc 40.Nd command script for auto\-reboot and daemons 41.Sh SYNOPSIS 42.Nm rc 43.Nm rc.local 44.Sh DESCRIPTION 45.Nm Rc 46is the command script which controls the automatic reboot and 47.Nm rc.local 48is the script holding commands which are pertinent only 49to a specific site. 50.Pp 51When an automatic reboot is in progress, 52.Nm rc 53is invoked with the argument 54.Em autoboot . 55The first portion of 56.Nm rc 57runs an 58.Xr fsck 8 59with option 60.Fl p 61to ``preen'' all the disks of minor inconsistencies resulting 62from the last system shutdown and to check for serious inconsistencies 63caused by hardware or software failure. 64If this auto-check and repair succeeds, then the second part of 65.Nm rc 66is run. 67.Pp 68The second part of 69.Nm rc , 70which is run after an auto-reboot succeeds and also if 71.Nm rc 72is invoked when a single user shell terminates (see 73.Xr init 8 ) , 74starts all the daemons on the system, preserves editor files 75and clears the scratch directory 76.Pa /tmp . 77.Pp 78.Nm Rc.local 79is executed immediately before any other commands after a successful 80.Nm fsck . 81Normally, the first commands placed in the 82.Nm rc.local 83file define the machine's name, using 84.Xr hostname 1 , 85and save any possible core image that might have been 86generated as a result of a system crash, with 87.Xr savecore 8 . 88The latter command is included in the 89.Nm rc.local 90file because the directory in which core dumps are saved 91is usually site specific. 92.Pp 93Following tradition, the startup files 94.Nm rc 95and 96.Nm rc.local 97reside in 98.Pa /etc . 99.Sh SEE ALSO 100.Xr init 8 , 101.Xr reboot 8 , 102.Xr savecore 8 103.Sh HISTORY 104The 105.Nm 106command appeared in 107.Bx 4.0 . 108