1shutdown(1M) System Administration Commands shutdown(1M)
2
3
4
6 shutdown - shut down system, change system state
7
9 /usr/sbin/shutdown [-y] [-g grace-period] [-i init-state]
10 [message]
11
12
14 shutdown is executed by the super user to change the state of the
15 machine. In most cases, it is used to change from the multi-user state
16 (state 2) to another state.
17
18
19 By default, shutdown brings the system to a state where only the con‐
20 sole has access to the operating system. This state is called single-
21 user.
22
23
24 Before starting to shut down daemons and killing processes, shutdown
25 sends a warning message and, by default, a final message asking for
26 confirmation. message is a string that is sent out following the stan‐
27 dard warning message "The system will be shut down in ..." If the
28 string contains more than one word, it should be contained within sin‐
29 gle (') or double (") quotation marks.
30
31
32 The warning message and the user provided message are output when there
33 are 7200, 3600, 1800, 1200, 600, 300, 120, 60, and 30 seconds remaining
34 before shutdown begins. See EXAMPLES.
35
36
37 System state definitions are:
38
39 state 0 Stop the operating system.
40
41
42 state 1 State 1 is referred to as the administrative state. In
43 state 1 file systems required for multi-user operations
44 are mounted, and logins requiring access to multi-user
45 file systems can be used. When the system comes up from
46 firmware mode into state 1, only the console is active
47 and other multi-user (state 2) services are unavailable.
48 Note that not all user processes are stopped when transi‐
49 tioning from multi-user state to state 1.
50
51
52 state s, S State s (or S) is referred to as the single-user state.
53 All user processes are stopped on transitions to this
54 state. In the single-user state, file systems required
55 for multi-user logins are unmounted and the system can
56 only be accessed through the console. Logins requiring
57 access to multi-user file systems cannot be used.
58
59
60 state 5 Shut the machine down so that it is safe to remove the
61 power. Have the machine remove power, if possible. The
62 rc0 procedure is called to perform this task.
63
64
65 state 6 Stop the operating system and reboot to the state defined
66 by the initdefault entry in /etc/inittab. The rc6 proce‐
67 dure is called to perform this task.
68
69
71 -y Pre-answer the confirmation question so the command
72 can be run without user intervention.
73
74
75 -g grace-period Allow the super user to change the number of seconds
76 from the 60-second default.
77
78
79 -i init-state If there are warnings, init-state specifies the
80 state init is to be in. By default, system state `s'
81 is used.
82
83
85 Example 1 Using shutdown
86
87
88 In the following example, shutdown is being executed on host foo and is
89 scheduled in 120 seconds. The warning message is output 2 minutes, 1
90 minute, and 30 seconds before the final confirmation message.
91
92
93 example# shutdown -i S -g 120 "===== disk replacement ====="
94 Shutdown started. Tue Jun 7 14:51:40 PDT 1994
95
96 Broadcast Message from root (pts/1) on foo Tue Jun 7 14:51:41...
97 The system will be shut down in 2 minutes
98 ===== disk replacement =====
99 Broadcast Message from root (pts/1) on foo Tue Jun 7 14:52:41...
100 The system will be shut down in 1 minutes
101 ===== disk replacement =====
102 Broadcast Message from root (pts/1) on foo Tue Jun 7 14:53:41...
103 The system will be shut down in 30 seconds
104 ===== disk replacement =====
105 Do you want to continue? (y or n):
106
107
108
110 /etc/inittab controls process dispatching by init
111
112
114 See attributes(5) for descriptions of the following attributes:
115
116
117
118
119 ┌─────────────────────────────┬─────────────────────────────┐
120 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
121 ├─────────────────────────────┼─────────────────────────────┤
122 │Availability │SUNWcsu │
123 └─────────────────────────────┴─────────────────────────────┘
124
126 boot(1M), halt(1M), init(1M), killall(1M), reboot(1M), ufsdump(1M),
127 init.d(4), inittab(4), nologin(4), attributes(5)
128
130 When a system transitions down to the S or s state, the /etc/nologin
131 file (see nologin(4)) is created. Upon subsequent transition to state 2
132 (multi-user state), this file is removed by a script in the /etc/rc2.d
133 directory.
134
135
136
137SunOS 5.11 9 May 2001 shutdown(1M)