xref: /netbsd/sbin/reboot/reboot.8 (revision 6550d01e)
1.\"	$NetBSD: reboot.8,v 1.27 2010/12/12 11:38:42 pooka 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 October 21, 2008
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
56.Dv SIGTERM ,
57wait for up to 30 seconds for them to die, send a
58.Dv SIGKILL
59to the survivors and, respectively, power down, halt or restart the system.
60The action is logged, including entering a shutdown record into the login
61accounting file and sending a message via
62.Xr syslog 3 .
63.Pp
64The options are as follows:
65.Bl -tag -width Ds
66.It Fl d
67Create a dump before halting or restarting.
68This option is useful for debugging system dump procedures or
69capturing the state of a corrupted or misbehaving system.
70.It Fl l
71Suppress sending a message via
72.Xr syslog 3
73before halting or restarting.
74.It Fl n
75Do not flush the file system cache.
76This option should be used with extreme caution.
77It can be used if a disk or a processor is on fire.
78.It Fl p
79Attempt to powerdown the system.
80If the powerdown fails, or the system does not support
81software powerdown, the system will halt.
82This option is only valid for
83.Nm halt .
84.It Fl q
85Do not give processes a chance to shut down before halting or restarting.
86This option should not normally be used.
87.El
88.Pp
89If there are any arguments passed to
90.Nm reboot
91they are concatenated with spaces and passed as
92.Fa bootstr
93to the
94.Xr reboot 2
95system call.
96The string is passed to the firmware on platforms that support it.
97.Pp
98Normally, the
99.Xr shutdown 8
100utility is used when the system needs to be halted or restarted, giving
101users advance warning of their impending doom.
102.Sh SEE ALSO
103.Xr reboot 2 ,
104.Xr syslog 3 ,
105.Xr utmp 5 ,
106.Xr boot 8 ,
107.Xr init 8 ,
108.Xr rescue 8 ,
109.Xr shutdown 8 ,
110.Xr sync 8
111.Sh HISTORY
112A
113.Nm
114command appeared in
115.At v6 .
116.Pp
117The
118.Nm poweroff
119command first appeared in
120.Nx 1.5 .
121.Sh CAVEATS
122Once the command has begun its work, stopping it before it completes
123will probably result in a system so crippled it must be
124physically reset.
125To prevent premature termination, the command
126blocks many signals early in its execution.
127However, nothing can defend against deliberate attempts to evade this.
128.Pp
129This command will stop the system without running any
130.Xr shutdown 8
131scripts.
132Amongst other things, this means that swapping will not be
133disabled so that
134.Xr raid 4
135can shutdown cleanly.
136You should normally use
137.Xr shutdown 8
138unless you are running in single user mode.
139.Sh BUGS
140The single user shell will ignore the
141.Dv SIGTERM
142signal.
143To avoid waiting for the timeout when
144rebooting or halting from the single user shell, you have to
145.Ic exec reboot
146or
147.Ic exec halt .
148