JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Booting and Shutting Down Oracle Solaris 11.1 Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Booting and Shutting Down a System (Overview)

2.  x86: Administering the GRand Unified Bootloader (Tasks)

3.  Shutting Down a System (Tasks)

Shutting Down a System

Guidelines for Shutting Down a System

System Shutdown Commands

Shutting Down a System

How to Determine Who Is Logged in to the System

How to Shut Down a System by Using the shutdown Command

How to Shut Down a Stand-Alone System by Using the init Command

Turning Off Power to System Devices

4.  Booting a System (Tasks)

5.  Booting a System From the Network (Tasks)

6.  Troubleshooting Booting a System (Tasks)

Index

Shutting Down a System

The following procedures and examples describe how to shut down a system by using the shutdown and init commands.

For information about shutting down a system for recovery purposes, including using the halt command, see SPARC: How to Stop a System for Recovery Purposes.

How to Determine Who Is Logged in to the System

For Oracle Solaris systems that are used as multiuser timesharing systems, you might need to determine if any users are logged into the system before shutting it down. Use the following procedure in these instances.

How to Shut Down a System by Using the shutdown Command

  1. Assume the root role.

    See How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. For a server shutdown, find out if any users are logged in to the system.
    # who

    A list of all logged-in users is displayed.

  3. Shut down the system.
    # shutdown -iinit-state -ggrace-period -y
    -iinit-state

    Brings the system to an init state that is different from the default of S. The choices are 0, 1, 2, 5, and 6.

    Run levels 0 and 5 are states reserved for shutting the system down. Run level 6 reboots the system. Run level 2 is available as a multiuser operating state.

    -ggrace-period

    Indicates a time (in seconds) before the system is shut down. The default is 60 seconds.

    -y

    Continues to shut down the system without intervention. Otherwise, you are prompted to continue the shutdown process after 60 seconds.

    For more information, see the shutdown(1M) man page.

  4. If you are asked for confirmation, type y.
    Do you want to continue? (y or n): y

    If you used the shutdown -y command, you will not be prompted to continue.

  5. Type the root password, if prompted.
    Type Ctrl-d to proceed with normal startup,
    (or give root password for system maintenance): xxxxxx
  6. After you have finished performing any system administration tasks, press Control-D to return to the default system run level.
  7. Use the following table to verify that the system is at the run level that you specified in the shutdown command.
    Specified Run Level
    x86 Based System Prompt
    SPARC Based System Prompt
    S (single-user state)
    #
    #
    0 (power-down state)
    #
    ok or >
    Run level 3 (multiuser state with remote resources shared)
    hostname console login:
    hostname console login:

Example 3-1 Bringing a System to a Single-User State (Run Level S) by Using the shutdown Command

In the following example, the shutdown command is used to bring a system to run level S (the single-user state) in three minutes.

# who
root     console      Apr 15 06:20

# shutdown -g180 -y

Shutdown started.    Fri Apr 15 06:20:45 MDT 2011

Broadcast Message from root (console) on portia Fri Apr 15 06:20:46...
The system portia will be shut down in 3 minutes

showmount: portia: RPC: Program not registered
Broadcast Message from root (console) on portia Fri Apr 15 06:21:46...
The system portia will be shut down in 2 minutes

showmount: portia: RPC: Program not registered
Broadcast Message from root (console) on portia Fri Apr 15 06:22:46...
The system portia will be shut down in 1 minute

showmount: portia: RPC: Program not registered
Broadcast Message from root (console) on portia Fri Apr 15 06:23:16...
The system portia will be shut down in 30 seconds

showmount: portia: RPC: Program not registered
Changing to init state s - please wait
svc.startd: The system is coming down for administration.  Please wait.
root@portia:~# Apr 15 06:24:28 portia svc.startd[9]:

Apr 15 06:24:28 portia syslogd: going down on signal 15
svc.startd: Killing user processes.
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
SINGLE USER MODE

Enter user name for system maintenance (control-d to bypass):xxxxxx
#

Example 3-2 Bringing a System to a Shutdown State (Run Level 0) by Using the shutdown Command

In the following example, the shutdown command is used to bring a system to run level 0 in five minutes without requiring additional confirmation.

# who
root       console       Jun 17 12:39...
userabc         pts/4        Jun 17 12:39   (:0.0)
# shutdown -i0 -g300 -y
Shutdown started.    Fri Apr 15 06:35:48 MDT 2011

Broadcast Message from root (console) on murky Fri Apr 15 06:35:48...
The system pinkytusk will be shut down in 5 minutes

showmount: murkey: RPC: Program not registered
showmount: murkey: RPC: Program not registered
Broadcast Message from root (console) on murkey Fri Apr 15 06:38:48...
The system murkey will be shut down in 2 minutes

showmount: murkey: RPC: Program not registered
Broadcast Message from root (console) on murkey Fri Apr 15 06:39:48...
The system murkey will be shut down in 1 minute

showmount: murkey: RPC: Program not registered
Broadcast Message from root (console) on murkey Fri Apr 15 06:40:18...
The system murkey  will be shut down in 30 seconds

showmount: murkey: RPC: Program not registered
Broadcast Message from root (console) on murkey Fri Apr 15 06:40:38...
THE SYSTEM murkey IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

showmount: murkey: RPC: Program not registered
Changing to init state 0 - please wait
root@murkey:~# svc.startd: The system is coming down.  Please wait.
svc.startd: 122 system services are now being stopped.
Apr 15 06:41:49 murkey svc.startd[9]:
Apr 15 06:41:50 murkey syslogd: going down on signal 15
svc.startd: Killing user processes.
Apr 15 06:41:57 The system is down.  Shutdown took 69 seconds.
syncing file systems... done
Press any key to reboot.
Resetting...

If you are bringing the system to run level 0 to turn off power to all devices, see Turning Off Power to System Devices.

Example 3-3 Bringing a System to a Multiuser State (Run Level 3) by Using the shutdown Command

In the following example, the shutdown command is used to reboot a system to run level 3 in two minutes. No additional confirmation is required.

# who
root           console      Jun 14 15:49    (:0)
userabc    pts/4        Jun 14 15:46    (:0.0)
# shutdown -i6 -g120 -y
Shutdown started.    Fri Apr 15 06:46:50 MDT 2011

Broadcast Message from root (console) on venus Fri Apr 15 06:46:50...
The system venus will be shut down in 2 minutes

showmount: venus: RPC: Program not registered
showmount: venus: RPC: Program not registered
Broadcast Message from root (console) on venus Fri Apr 15 06:47:50...
The system venus will be shut down in 1 minute

showmount: venus: RPC: Program not registered
showmount: venus: RPC: Program not registered
Broadcast Message from root (console) on venus Fri Apr 15 06:48:20...
The system venus will be shut down in 30 seconds

showmount: venus: RPC: Program not registered
Broadcast Message from root (console) on venus Fri Apr 15 06:48:40...
THE SYSTEM venus IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

showmount: venus: RPC: Program not registered
Changing to init state 6 - please wait
root@venus:~# svc.startd: The system is coming down.  Please wait.
svc.startd: 123 system services are now being stopped.
Apr 15 06:49:32 venus svc.startd[9]:
Apr 15 06:49:32 venus syslogd: going down on signal 15
svc.startd: Killing user processes.
Apr 15 06:49:40 The system is down.  Shutdown took 50 seconds.
syncing file systems... done
rebooting...
SunOS Release 5.11 Version 2010-12-10 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Booting to milestone "milestone/single-user:default".
Hostname: venus
NIS domain name is solaris.example.com
.
.
.
venus console login:

See Also

Regardless of why you shut down a system, you will probably want to return to run level 3, where all file resources are available, and users can log in. For instructions on bringing a system back to a multiuser state, see Chapter 4, Booting a System (Tasks).

How to Shut Down a Stand-Alone System by Using the init Command

Use this procedure when you need to shut down a stand-alone system.

  1. Assume the root role.

    See How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Shut down the system.
    # init 5

    For more information, see the init(1M) man page.

Example 3-4 Bringing a System to a Shutdown State (Run Level 0) by Using the init Command

In this example, the init command is used to bring a stand-alone system to the run level where it is safe to turn off power.

# init 0
#
INIT: New run level: 0
The system is coming down.  Please wait.
.
.
.

The system is down.
syncing file systems... [11] [10] [3] done
Press any key to reboot

See Also

Regardless of why you shut down the system, you will probably want to return to run level 3, where all file resources are available, and users can log in.