[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Quick Beginnings

Shutting Down Your System

A system shutdown is a shell script that properly prepares a system with multiple users to be turned off or rebooted. An improper shutdown can have undesirable results on the file system. On a single-user system, shut down when your system needs servicing, when you are going to move your computer, or when you cannot reboot.

From the user's viewpoint, shutting down a system is simple, but from the system's viewpoint, the shutdown process actually involves a series of events designed to preserve file integrity.

There are several controlled situations when you may want to shut down your system:

The shutdown command is the safest and most thorough way to halt the operating system. When you designate the appropriate flags, this command notifies users that the system is about to stop operations, terminate all existing processes, unmount file systems, and shut down the system.

The steps that take place during a system shutdown depend on how the system was customized. The shutdown described in this section may not appear exactly the same on your system.

Note: You must have root user authority to shut down the system.

To Shut Down and Turn Off the System

  1. At the prompt, type:
    shutdown
    The system shuts down; the system waits one minute before stopping the user processes and the init process. You will see the following message:
    shutdown completed...
  2. Turn off the system and the devices attached to it.

To Shut Down and Reboot the System

When the -r flag is specified with the shutdown command, the system reboots after it completes the shutdown.

To Shut Down to Single-User Mode

In some cases, you may need to shut down the system and enter single-user mode (also referred to as maintenance or standalone mode) to perform software maintenance and diagnostics.

  1. To change to the root directory, at the prompt, type:
    cd /

    You must be in the root directory to shut down the system to single-user mode. This ensures that file systems are unmounted cleanly.

  2. At the prompt, type:
    shutdown -m
    The system shuts down to single-user mode. A system prompt displays, and you can perform maintenance activities.

To Shut Down in an Emergency

You can also use the shutdown command to shut down the system under emergency conditions. Use this procedure to stop the system quickly without notifying other users.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]