]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/libc/sys/reboot.2
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / libc / sys / reboot.2
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 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)reboot.2    8.1 (Berkeley) 6/4/93
29 .\" $FreeBSD$
30 .\"
31 .Dd June 4, 1993
32 .Dt REBOOT 2
33 .Os
34 .Sh NAME
35 .Nm reboot
36 .Nd reboot system or halt processor
37 .Sh LIBRARY
38 .Lb libc
39 .Sh SYNOPSIS
40 .In unistd.h
41 .In sys/reboot.h
42 .Ft int
43 .Fn reboot "int howto"
44 .Sh DESCRIPTION
45 The
46 .Fn reboot
47 system call
48 reboots the system.
49 Only the super-user may reboot a machine on demand.
50 However, a reboot is invoked
51 automatically in the event of unrecoverable system failures.
52 .Pp
53 The
54 .Fa howto
55 argument
56 is a mask of options; the system call interface allows the following
57 options, defined in the include file
58 .In sys/reboot.h ,
59 to be passed
60 to the new kernel or the new bootstrap and init programs.
61 .Bl -tag -width RB_INITNAMEA
62 .It Dv RB_AUTOBOOT
63 The default, causing the system to reboot in its usual fashion.
64 .It Dv RB_ASKNAME
65 Interpreted by the bootstrap program itself, causing it to
66 prompt on the console as to what file should be booted.
67 Normally, the system is booted from the file
68 .Dq Ar xx Ns No (0,0)kernel ,
69 where
70 .Ar xx
71 is the default disk name,
72 without prompting for the file name.
73 .It Dv RB_DFLTROOT
74 Use the compiled in root device.
75 Normally, the system uses the device from which it was booted
76 as the root device if possible.
77 (The default behavior is dependent on the ability of the bootstrap program
78 to determine the drive from which it was loaded, which is not possible
79 on all systems.)
80 .It Dv RB_DUMP
81 Dump kernel memory before rebooting; see
82 .Xr savecore 8
83 for more information.
84 .It Dv RB_HALT
85 the processor is simply halted; no reboot takes place.
86 This option should be used with caution.
87 .It Dv RB_POWEROFF
88 After halting, the shutdown code will do what it can to turn
89 off the power.
90 This requires hardware support.
91 .It Dv RB_INITNAME
92 An option allowing the specification of an init program (see
93 .Xr init 8 )
94 other than
95 .Pa /sbin/init
96 to be run when the system reboots.
97 This switch is not currently available.
98 .It Dv RB_KDB
99 Load the symbol table and enable a built-in debugger in the system.
100 This option will have no useful function if the kernel is not configured
101 for debugging.
102 Several other options have different meaning if combined
103 with this option, although their use may not be possible
104 via the
105 .Fn reboot
106 system call.
107 See
108 .Xr ddb 4
109 for more information.
110 .It Dv RB_NOSYNC
111 Normally, the disks are sync'd (see
112 .Xr sync 8 )
113 before the processor is halted or rebooted.
114 This option may be useful if file system changes have been made manually
115 or if the processor is on fire.
116 .It Dv RB_RDONLY
117 Initially mount the root file system read-only.
118 This is currently the default, and this option has been deprecated.
119 .It Dv RB_SINGLE
120 Normally, the reboot procedure involves an automatic disk consistency
121 check and then multi-user operations.
122 .Dv RB_SINGLE
123 prevents this, booting the system with a single-user shell
124 on the console.
125 .Dv RB_SINGLE
126 is actually interpreted by the
127 .Xr init 8
128 program in the newly booted system.
129 .El
130 .Pp
131 When no options are given (i.e.,
132 .Dv RB_AUTOBOOT
133 is used), the system is
134 rebooted from file
135 .Dq kernel
136 in the root file system of unit 0
137 of a disk chosen in a processor specific way.
138 An automatic consistency check of the disks is normally performed
139 (see
140 .Xr fsck 8 ) .
141 .Sh RETURN VALUES
142 If successful, this call never returns.
143 Otherwise, a -1 is returned and an error is returned in the global
144 variable
145 .Va errno .
146 .Sh ERRORS
147 .Bl -tag -width Er
148 .It Bq Er EPERM
149 The caller is not the super-user.
150 .El
151 .Sh SEE ALSO
152 .Xr crash 8 ,
153 .Xr halt 8 ,
154 .Xr init 8 ,
155 .Xr reboot 8 ,
156 .Xr savecore 8
157 .Sh HISTORY
158 The
159 .Fn reboot
160 system call appeared in
161 .Bx 4.0 .
162 .Sh BUGS
163 The HP300 implementation supports neither
164 .Dv RB_DFLTROOT
165 nor
166 .Dv RB_KDB .