xref: /netbsd-src/sbin/reboot/reboot.8 (revision 0df165c04d0a9ca1adde9ed2b890344c937954a6)
1.\"	$NetBSD: reboot.8,v 1.23 2007/06/03 22:39:47 uwe Exp $
2.\"
3.\" Copyright (c) 1990, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)reboot.8	8.1 (Berkeley) 6/9/93
31.\"
32.Dd June 3, 2007
33.Dt REBOOT 8
34.Os
35.Sh NAME
36.Nm reboot ,
37.Nm poweroff ,
38.Nm halt
39.Nd restarting, powering down and stopping the system
40.Sh SYNOPSIS
41.Nm halt
42.Op Fl dlnpq
43.Nm poweroff
44.Op Fl dlnq
45.Nm
46.Op Fl dlnq
47.Op Ar arg ...
48.Sh DESCRIPTION
49The
50.Nm poweroff ,
51.Nm halt
52and
53.Nm
54utilities flush the file system cache to disk, send all running processes
55a SIGTERM, wait for several seconds for them to die, send a SIGKILL to the
56survivors and, respectively, power down, halt or restart the system.
57The action is logged, including entering a shutdown record into the login
58accounting file and sending a message via
59.Xr syslog 3 .
60.Pp
61The options are as follows:
62.Bl -tag -width Ds
63.It Fl d
64Create a dump before halting or restarting.
65This option is useful for debugging system dump procedures or
66capturing the state of a corrupted or misbehaving system.
67.It Fl l
68Suppress sending a message via
69.Xr syslog 3
70before halting or restarting.
71.It Fl n
72Do not flush the file system cache.
73This option should be used with extreme caution.
74It can be used if a disk or the processor is on fire.
75.It Fl p
76Attempt to powerdown the system.
77If the powerdown fails, or the system does not support
78software powerdown, the system will halt.
79This option is only valid for
80.Nm halt .
81.It Fl q
82Do not give processes a chance to shut down before halting or restarting.
83This option should not normally be used.
84.El
85.Pp
86If there are any arguments passed to
87.Nm reboot
88they are concatenated with spaces and passed as
89.Fa bootstr
90to
91.Xr reboot 2
92system call.
93The string is passed to the firmware on platforms that support it.
94.Pp
95Normally, the
96.Xr shutdown 8
97utility is used when the system needs to be halted or restarted, giving
98users advance warning of their impending doom.
99.Sh SEE ALSO
100.Xr reboot 2 ,
101.Xr syslog 3 ,
102.Xr utmp 5 ,
103.Xr boot 8 ,
104.Xr shutdown 8 ,
105.Xr sync 8
106.Sh HISTORY
107A
108.Nm
109command appeared in
110.At v6 .
111.Pp
112The
113.Nm poweroff
114command first appeared in
115.Nx 1.5 .
116.Sh CAVEATS
117Once the command has begun its work, stopping it before it completes
118will probably result in a system so crippled it must be
119physically reset.
120To prevent premature termination, the command
121blocks many signals early in its execution.
122However, nothing can defend against deliberate attempts to evade this.
123.Pp
124This command will stop the system without running any
125.Xr shutdown 8
126scripts.  Amongst other things, this means that swapping will not be
127disabled so that
128.Xr raid 4
129can shutdown cleanly.  You should normally use
130.Xr shutdown 8
131unless you are running in single user mode.
132.Sh BUGS
133The single user shell will ignore the SIGTERM signal.
134To avoid waiting for the timeout when
135rebooting or halting from the single user shell, you have to
136.Ic exec reboot
137or
138.Ic exec halt .
139