Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man8 / shutdown.8
blob117027ebda8f59cd156d97b6f95b0631bd53f995
1 '\" te
2 .\" Copyright (c) 2001 Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH SHUTDOWN 8 "May 9, 2001"
8 .SH NAME
9 shutdown \- shut down system, change system state
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/shutdown\fR [\fB-y\fR] [\fB-g\fR \fIgrace-period\fR] [\fB-i\fR \fIinit-state\fR]
14      [\fImessage\fR]
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 \fBshutdown\fR is executed by the super user to change the state of the
21 machine. In most cases, it is used to change from the multi-user state (state
22 2) to another state.
23 .sp
24 .LP
25 By default, \fBshutdown\fR brings the system to a state where only the console
26 has access to the operating system. This state is called single-user.
27 .sp
28 .LP
29 Before starting to shut down daemons and killing processes, \fBshutdown\fR
30 sends a warning message and, by default, a final message asking for
31 confirmation. \fImessage\fR is a string that is sent out following the standard
32 warning message "The system will be shut down in .\|.\|." If the string
33 contains more than one word, it should be contained within single (\fB\&'\fR)
34 or double (\fB"\fR) quotation marks.
35 .sp
36 .LP
37 The warning message and the user provided \fImessage\fR are output when there
38 are 7200, 3600, 1800, 1200, 600, 300, 120, 60, and 30 seconds remaining before
39 \fBshutdown\fR begins. See \fBEXAMPLES\fR.
40 .sp
41 .LP
42 System state definitions are:
43 .sp
44 .ne 2
45 .na
46 \fBstate 0\fR
47 .ad
48 .RS 14n
49 Stop the operating system.
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fBstate 1\fR
56 .ad
57 .RS 14n
58 State 1 is referred to as the administrative state. In state 1 file systems
59 required for multi-user operations are mounted, and logins requiring access to
60 multi-user file systems can be used. When the system comes up from firmware
61 mode into state 1, only the console is active and other multi-user (state 2)
62 services are unavailable. Note that not all user processes are stopped when
63 transitioning from multi-user state to state 1.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fBstate s, S\fR
70 .ad
71 .RS 14n
72 State s (or S) is referred to as the single-user state. All user processes are
73 stopped on transitions to this state. In the single-user state, file systems
74 required for multi-user logins are unmounted and the system can only be
75 accessed through the console. Logins requiring access to multi-user file
76 systems cannot be used.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fBstate 5\fR
83 .ad
84 .RS 14n
85 Shut the machine down so that it is safe to remove the power. Have the machine
86 remove power, if possible. The \fBrc0\fR procedure is called to perform this
87 task.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fBstate 6\fR
94 .ad
95 .RS 14n
96 Stop the operating system and reboot to the state defined by the
97 \fBinitdefault\fR entry in \fB/etc/inittab\fR. The \fBrc6\fR procedure is
98 called to perform this task.
99 .RE
101 .SH OPTIONS
103 .ne 2
105 \fB\fB-y\fR\fR
107 .RS 19n
108 Pre-answer the confirmation question so the command can be run without user
109 intervention.
113 .ne 2
115 \fB\fB-g\fR\fI grace-period\fR\fR
117 .RS 19n
118 Allow the super user to change the number of seconds from the 60-second
119 default.
123 .ne 2
125 \fB\fB-i\fR\fI init-state\fR\fR
127 .RS 19n
128 If there are warnings, \fIinit-state\fR specifies the state \fBinit\fR is to be
129 in. By default, system state `\fBs\fR' is used.
132 .SH EXAMPLES
134 \fBExample 1 \fRUsing \fBshutdown\fR
137 In the following example, \fBshutdown\fR is being executed on host \fBfoo\fR
138 and is scheduled in 120 seconds. The warning message is output 2 minutes, 1
139 minute, and 30 seconds before the final confirmation message.
142 .in +2
144 example# shutdown -i S -g 120 "===== disk replacement ====="
145 Shutdown started.   Tue Jun   7  14:51:40 PDT  1994
147 Broadcast Message from root (pts/1) on foo Tue Jun  7 14:51:41.\|.\|.
148 The system will be shut down in 2 minutes
149 ===== disk replacement =====
150 Broadcast Message from root (pts/1) on foo Tue Jun  7 14:52:41.\|.\|.
151 The system will be shut down in 1 minutes
152 ===== disk replacement =====
153 Broadcast Message from root (pts/1) on foo Tue Jun  7 14:53:41.\|.\|.
154 The system will be shut down in 30 seconds
155 ===== disk replacement =====
156 Do you want to continue? (y or n):
158 .in -2
161 .SH FILES
163 .ne 2
165 \fB\fB/etc/inittab\fR\fR
167 .RS 16n
168 controls process dispatching by \fBinit\fR
171 .SH SEE ALSO
174 \fBboot\fR(8), \fBhalt\fR(8), \fBinit\fR(8), \fBkillall\fR(8),
175 \fBreboot\fR(8), \fBufsdump\fR(8), \fBinit.d\fR(4), \fBinittab\fR(4),
176 \fBnologin\fR(4), \fBattributes\fR(5)
177 .SH NOTES
180 When a system transitions down to the \fBS\fR or \fBs\fR state, the
181 \fB/etc/nologin\fR file (see \fBnologin\fR(4)) is created. Upon subsequent
182 transition to state 2 (multi-user state), this file is removed by a script in
183 the \fB/etc/rc2.d\fR directory.