1*2fe8fb19SBen Gras.\" $NetBSD: reboot.2,v 1.29 2010/03/22 19:30:55 joerg Exp $ 2*2fe8fb19SBen Gras.\" 3*2fe8fb19SBen Gras.\" Copyright (c) 1980, 1991, 1993 4*2fe8fb19SBen Gras.\" The Regents of the University of California. All rights reserved. 5*2fe8fb19SBen Gras.\" 6*2fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without 7*2fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions 8*2fe8fb19SBen Gras.\" are met: 9*2fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright 10*2fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer. 11*2fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 12*2fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer in the 13*2fe8fb19SBen Gras.\" documentation and/or other materials provided with the distribution. 14*2fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 15*2fe8fb19SBen Gras.\" may be used to endorse or promote products derived from this software 16*2fe8fb19SBen Gras.\" without specific prior written permission. 17*2fe8fb19SBen Gras.\" 18*2fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19*2fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20*2fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21*2fe8fb19SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22*2fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23*2fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24*2fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25*2fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26*2fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27*2fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28*2fe8fb19SBen Gras.\" SUCH DAMAGE. 29*2fe8fb19SBen Gras.\" 30*2fe8fb19SBen Gras.\" @(#)reboot.2 8.1 (Berkeley) 6/4/93 31*2fe8fb19SBen Gras.\" 32*2fe8fb19SBen Gras.Dd September 4, 2009 33*2fe8fb19SBen Gras.Dt REBOOT 2 34*2fe8fb19SBen Gras.Os 35*2fe8fb19SBen Gras.Sh NAME 36*2fe8fb19SBen Gras.Nm reboot 37*2fe8fb19SBen Gras.Nd reboot system or halt processor 38*2fe8fb19SBen Gras.Sh LIBRARY 39*2fe8fb19SBen Gras.Lb libc 40*2fe8fb19SBen Gras.Sh SYNOPSIS 41*2fe8fb19SBen Gras.In unistd.h 42*2fe8fb19SBen Gras.In sys/reboot.h 43*2fe8fb19SBen Gras.Ft int 44*2fe8fb19SBen Gras.Fn reboot "int howto" "char *bootstr" 45*2fe8fb19SBen Gras.Sh DESCRIPTION 46*2fe8fb19SBen Gras.Fn reboot 47*2fe8fb19SBen Grasreboots the system. 48*2fe8fb19SBen GrasOnly the super-user may reboot a machine on demand. 49*2fe8fb19SBen GrasHowever, a reboot is invoked 50*2fe8fb19SBen Grasautomatically in the event of unrecoverable system failures. 51*2fe8fb19SBen Gras.Pp 52*2fe8fb19SBen Gras.Fa howto 53*2fe8fb19SBen Grasis a mask of options; the system call interface allows the following 54*2fe8fb19SBen Grasoptions, defined in the include file 55*2fe8fb19SBen Gras.In sys/reboot.h , 56*2fe8fb19SBen Grasto be passed 57*2fe8fb19SBen Grasto the new kernel or the new bootstrap and init programs. 58*2fe8fb19SBen GrasIn addition to the options described below, other options 59*2fe8fb19SBen Grasdescribed in 60*2fe8fb19SBen Gras.Xr boothowto 9 61*2fe8fb19SBen Grasmay be set, but such options may be ignored by the system. 62*2fe8fb19SBen Gras.Pp 63*2fe8fb19SBen GrasOptions can be combined together by OR'ing them, eg. 64*2fe8fb19SBen Gras.Dv RB_DUMP | 65*2fe8fb19SBen Gras.Dv RB_NOSYNC 66*2fe8fb19SBen Graswould be interpreted as 67*2fe8fb19SBen Gras.Dq dump kernel memory before rebooting and don't sync the disks . 68*2fe8fb19SBen Gras.Bl -column RB_INITNAMEA 0x0000 69*2fe8fb19SBen Gras.It Dv RB_AUTOBOOT Ta Li 0x0000 Ta 70*2fe8fb19SBen GrasThe default, causing the system to reboot in its usual fashion. 71*2fe8fb19SBen Gras.It Dv RB_ASKNAME Ta Li 0x0001 Ta 72*2fe8fb19SBen GrasInterpreted by the bootstrap program itself, causing it to 73*2fe8fb19SBen Grasprompt on the console as to what file should be booted. 74*2fe8fb19SBen GrasNormally, the system is booted from the file 75*2fe8fb19SBen Gras.Dq Em xx Ns No (0,0)netbsd , 76*2fe8fb19SBen Graswhere 77*2fe8fb19SBen Gras.Em xx 78*2fe8fb19SBen Grasis the default disk name, 79*2fe8fb19SBen Graswithout prompting for the file name. 80*2fe8fb19SBen Gras.\" Obsolete! 81*2fe8fb19SBen Gras.\" .It Dv RB_DFLTROOT Ta Li 0x0020 Ta 82*2fe8fb19SBen Gras.\" Use the compiled in root device. 83*2fe8fb19SBen Gras.\" Normally, the system uses the device from which it was booted 84*2fe8fb19SBen Gras.\" as the root device if possible. 85*2fe8fb19SBen Gras.\" (The default behavior is dependent on the ability of the bootstrap program 86*2fe8fb19SBen Gras.\" to determine the drive from which it was loaded, which is not possible 87*2fe8fb19SBen Gras.\" on all systems.) 88*2fe8fb19SBen Gras.It Dv RB_DUMP Ta Li 0x0100 Ta 89*2fe8fb19SBen GrasDump kernel memory before rebooting; see 90*2fe8fb19SBen Gras.Xr savecore 8 91*2fe8fb19SBen Grasfor more information. 92*2fe8fb19SBen Gras.It Dv RB_HALT Ta Li 0x0008 Ta 93*2fe8fb19SBen Grasthe processor is simply halted; no reboot takes place. 94*2fe8fb19SBen GrasThis option should be used with caution. 95*2fe8fb19SBen Gras.It Dv RB_POWERDOWN Ta Li 0x0808 Ta 96*2fe8fb19SBen GrasThis option is always used in conjunction with 97*2fe8fb19SBen Gras.Dv RB_HALT , 98*2fe8fb19SBen Grasand if the system hardware supports the function, the system will be 99*2fe8fb19SBen Graspowered off, otherwise it has no effect. 100*2fe8fb19SBen Gras.It Dv RB_INITNAME Ta Li 0x0010 Ta 101*2fe8fb19SBen GrasAn option allowing the specification of an init program (see 102*2fe8fb19SBen Gras.Xr init 8 ) 103*2fe8fb19SBen Grasother than 104*2fe8fb19SBen Gras.Pa /sbin/init 105*2fe8fb19SBen Grasto be run when the system reboots. 106*2fe8fb19SBen GrasThis switch is not currently available. 107*2fe8fb19SBen Gras.It Dv RB_KDB Ta Li 0x0040 Ta 108*2fe8fb19SBen GrasLoad the symbol table and enable a built-in debugger in the system. 109*2fe8fb19SBen GrasThis option will have no useful function if the kernel is not configured 110*2fe8fb19SBen Grasfor debugging. 111*2fe8fb19SBen GrasSeveral other options have different meaning if combined 112*2fe8fb19SBen Graswith this option, although their use may not be possible 113*2fe8fb19SBen Grasvia the 114*2fe8fb19SBen Gras.Fn reboot 115*2fe8fb19SBen Grascall. 116*2fe8fb19SBen GrasSee 117*2fe8fb19SBen Gras.Xr ddb 4 118*2fe8fb19SBen Grasfor more information. 119*2fe8fb19SBen Gras.It Dv RB_NOSYNC Ta Li 0x0004 Ta 120*2fe8fb19SBen GrasNormally, the disks are sync'd (see 121*2fe8fb19SBen Gras.Xr sync 8 ) 122*2fe8fb19SBen Grasbefore the processor is halted or rebooted. 123*2fe8fb19SBen GrasThis option may be useful if file system changes have been made manually 124*2fe8fb19SBen Grasor if the processor is on fire. 125*2fe8fb19SBen Gras.It Dv RB_RDONLY Ta Li 0x0080 Ta 126*2fe8fb19SBen GrasInitially mount the root file system read-only. 127*2fe8fb19SBen GrasThis is currently the default, and this option has been deprecated. 128*2fe8fb19SBen Gras.It Dv RB_SINGLE Ta Li 0x0002 Ta 129*2fe8fb19SBen GrasNormally, the reboot procedure involves an automatic disk consistency 130*2fe8fb19SBen Grascheck and then multi-user operations. 131*2fe8fb19SBen Gras.Dv RB_SINGLE 132*2fe8fb19SBen Grasprevents this, booting the system with a single-user shell 133*2fe8fb19SBen Grason the console. 134*2fe8fb19SBen Gras.Dv RB_SINGLE 135*2fe8fb19SBen Grasis actually interpreted by the 136*2fe8fb19SBen Gras.Xr init 8 137*2fe8fb19SBen Grasprogram in the newly booted system. 138*2fe8fb19SBen Gras.Pp 139*2fe8fb19SBen GrasWhen no options are given (i.e., 140*2fe8fb19SBen Gras.Dv RB_AUTOBOOT 141*2fe8fb19SBen Grasis used), the system is 142*2fe8fb19SBen Grasrebooted from file ``netbsd'' in the root file system of unit 0 143*2fe8fb19SBen Grasof a disk chosen in a processor specific way. 144*2fe8fb19SBen GrasAn automatic consistency check of the disks is normally performed 145*2fe8fb19SBen Gras(see 146*2fe8fb19SBen Gras.Xr fsck 8 ) . 147*2fe8fb19SBen Gras.It Dv RB_STRING Ta Li 0x0400 Ta 148*2fe8fb19SBen Gras.Fa bootstr 149*2fe8fb19SBen Grasis a string passed to the firmware on the machine, if possible, if this 150*2fe8fb19SBen Grasoption is set. 151*2fe8fb19SBen GrasCurrently this is only implemented on the sparc and the sun3 ports. 152*2fe8fb19SBen Gras.It Dv RB_USERCONF Ta Li 0x1000 Ta 153*2fe8fb19SBen GrasInitially invoke the 154*2fe8fb19SBen Gras.Xr userconf 4 155*2fe8fb19SBen Grasfacility when the system starts up again, if it has been compiled into 156*2fe8fb19SBen Grasthe kernel that is loaded. 157*2fe8fb19SBen Gras.El 158*2fe8fb19SBen Gras.Sh RETURN VALUES 159*2fe8fb19SBen GrasIf successful, this call never returns. 160*2fe8fb19SBen GrasOtherwise, a \-1 is returned and an error is returned in the global 161*2fe8fb19SBen Grasvariable 162*2fe8fb19SBen Gras.Va errno . 163*2fe8fb19SBen Gras.Sh ERRORS 164*2fe8fb19SBen Gras.Bl -tag -width Er 165*2fe8fb19SBen Gras.It Bq Er EPERM 166*2fe8fb19SBen GrasThe caller is not the super-user. 167*2fe8fb19SBen Gras.El 168*2fe8fb19SBen Gras.Sh SEE ALSO 169*2fe8fb19SBen Gras.Xr ddb 4 , 170*2fe8fb19SBen Gras.Xr crash 8 , 171*2fe8fb19SBen Gras.Xr halt 8 , 172*2fe8fb19SBen Gras.Xr init 8 , 173*2fe8fb19SBen Gras.Xr reboot 8 , 174*2fe8fb19SBen Gras.Xr savecore 8 , 175*2fe8fb19SBen Gras.Xr boothowto 9 176*2fe8fb19SBen Gras.Sh HISTORY 177*2fe8fb19SBen GrasThe 178*2fe8fb19SBen Gras.Fn reboot 179*2fe8fb19SBen Grasfunction call appeared in 180*2fe8fb19SBen Gras.Bx 4.0 . 181*2fe8fb19SBen Gras.Pp 182*2fe8fb19SBen GrasThe 183*2fe8fb19SBen Gras.Dv RB_DFLTROOT 184*2fe8fb19SBen Grasoption is now 185*2fe8fb19SBen Gras.Em obsolete . 186