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