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