xref: /freebsd/sbin/reboot/reboot.8 (revision 315ee00f)
1.\" Copyright (c) 1990, 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. 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.8	8.1 (Berkeley) 6/9/93
29.\"
30.Dd December 20, 2017
31.Dt REBOOT 8
32.Os
33.Sh NAME
34.Nm reboot ,
35.Nm halt ,
36.Nm fastboot ,
37.Nm fasthalt
38.Nd stopping and restarting the system
39.Sh SYNOPSIS
40.Nm halt
41.Op Fl lNnpq
42.Op Fl k Ar kernel
43.Nm
44.Op Fl cdlNnpqr
45.Op Fl k Ar kernel
46.Nm fasthalt
47.Op Fl lNnpq
48.Op Fl k Ar kernel
49.Nm fastboot
50.Op Fl dlNnpq
51.Op Fl k Ar kernel
52.Sh DESCRIPTION
53The
54.Nm halt
55and
56.Nm
57utilities flush the file system cache to disk, send all running processes
58a
59.Dv SIGTERM
60(and subsequently a
61.Dv SIGKILL )
62and, respectively, halt or restart the system.
63The action is logged, including entering a shutdown record into the user
64accounting database.
65.Pp
66The options are as follows:
67.Bl -tag -width indent
68.It Fl c
69The system will turn off the power and then turn it back on if it can.
70If the power down action fails, the system
71will halt or reboot normally, depending on whether
72.Nm halt
73or
74.Nm
75was called.
76At the present time, only the
77.Xr ipmi 4
78driver implements the power cycle functionality and only on hardware
79with a BMC that supports power cycling.
80Unlike power off, the amount of hardware that supports power cycling
81is small.
82.It Fl d
83The system is requested to create a crash dump.
84This option is
85supported only when rebooting, and it has no effect unless a dump
86device has previously been specified with
87.Xr dumpon 8 .
88.It Fl k Ar kernel
89Boot the specified
90.Ar kernel
91on the next system boot.
92If the kernel boots successfully, the
93.Em default
94kernel will be booted on successive boots, this is a one-shot option.
95If the boot fails, the system will continue attempting to boot
96.Ar kernel
97until the boot process is interrupted and a valid kernel booted.
98This may change in the future.
99.It Fl l
100The halt or reboot is
101.Em not
102logged to the system log.
103This option is intended for applications such as
104.Xr shutdown 8 ,
105that call
106.Nm
107or
108.Nm halt
109and log this themselves.
110.It Fl N
111The file system cache is not flushed during the initial process clean-up,
112however the kernel level
113.Xr reboot 2
114is still processed with a sync.
115This option can be useful for performing a
116.Dq best-effort
117reboot when devices might be unavailable.
118This can happen when devices have been disconnected, such as with
119.Xr iscsi 4 .
120.It Fl n
121The file system cache is not flushed.
122This option should probably not be used.
123.It Fl p
124The system will turn off the power if it can.
125If the power down action fails, the system
126will halt or reboot normally, depending on whether
127.Nm halt
128or
129.Nm
130was called.
131.It Fl q
132The system is halted or restarted quickly and ungracefully, and only
133the flushing of the file system cache is performed (if the
134.Fl n
135option is not specified).
136This option should probably not be used.
137.It Fl r
138The system kills all processes, unmounts all filesystems, mounts the new
139root filesystem, and begins the usual startup sequence.
140After changing vfs.root.mountfrom with
141.Xr kenv 1 ,
142.Nm Fl r
143can be used to change the root filesystem while preserving kernel state.
144This requires the
145.Xr tmpfs 5
146kernel module to be loaded because
147.Xr init 8
148needs a place to store itself after the old root is unmounted, but
149before the new root is in place.
150.El
151.Pp
152The
153.Nm fasthalt
154and
155.Nm fastboot
156utilities are nothing more than aliases for the
157.Nm halt
158and
159.Nm
160utilities.
161.Pp
162Normally, the
163.Xr shutdown 8
164utility is used when the system needs to be halted or restarted, giving
165users advance warning of their impending doom and cleanly terminating
166specific programs.
167.Sh EXAMPLES
168Replace current root filesystem with UFS mounted from
169.Pa /dev/ada0s1a :
170.Bd -literal -offset indent
171kenv vfs.root.mountfrom=ufs:/dev/ada0s1a
172reboot -r
173.Ed
174.Pp
175This mechanism can also be used with NFS, with a caveat that
176it only works with NFSv4, and requires a numeric IPv4 address:
177.Bd -literal -offset indent
178kenv vfs.root.mountfrom=nfs:192.168.1.1:/share/name
179reboot -r
180.Ed
181.Sh SEE ALSO
182.Xr kenv 1 ,
183.Xr getutxent 3 ,
184.Xr ipmi 4 ,
185.Xr boot 8 ,
186.Xr dumpon 8 ,
187.Xr nextboot 8 ,
188.Xr savecore 8 ,
189.Xr shutdown 8 ,
190.Xr sync 8
191.Sh HISTORY
192A
193.Nm
194utility appeared in
195.Bx 4.0 .
196