halt or fasthalt Command

Purpose

Stops the processor.

Syntax

{halt | fasthalt} [-l] [-n] [-p] [-q] [-y]

Description

The halt command writes data to the disk and then stops the processor. The machine does not restart. Only a root user can run this command. Do not use this command if other users are logged in to the system. If no other users are logged in, the halt command can be used. Use the halt command if you are not going to restart the machine immediately. When the message ....Halt completed.... is displayed, you can turn off the power.

The halt command logs the shutdown by using the syslogd command and places a record of the shutdown in /var/adm/wtmp, the login accounting file. The system also writes an entry into the error log that states that the system was shut down.

The fasthalt command stops the system by calling the halt command. The fasthalt command provides BSD compatibility.

Flags

Item Description
-l Does not log the halt in the accounting file. The -l flag does not suppress accounting file update. The -n and -q flags imply the -l flag.
-n Prevents the sync before it stops.
-p Halts the system without a power down.
Note: The -p flag has no effect if used in combination with flags not requiring a permanent halt. Power is still turned off if other operands request a delayed power-on and restart.
-q Causes a quick halt.
Notes:
  • Running the halt command with -q flag does not issue sync, so the system halts immediately.
  • If you run the halt command with the -q flag in a workload partition (WPAR), the halt command can stop the WPAR and bring it to the D (defined) state. The WPAR might not stop completely and bring the WPAR to the T (transitional) state because of the timeout condition or a delay caused while unmounting the file system.
-y Halts the system from a dial-up operation.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To halt the system without logging the halt in the accounting file, enter the following command:
    halt -l 
  2. To halt the system quickly, enter the following command:
    halt -q
  3. To halt the system from a dial-up operation, enter the following command:
    halt -y

Files

Item Description
/etc/rc Specifies the system startup script.
/var/adm/wtmp Specifies the login accounting file.