Shutting down a Unix system is not as simple as shutting down a Windows 98 PC. There are many things that need to be done to safely and cleanly shut down the system. Luckilly the Unix operating system will do them all automatically if you use the right command to shut the system down.

SHUTDOWN

To gracefully shut down a system, use the shutdown command. This works on Solaris and on Unix systems, although the flags vary a small bit. Shutdown performs the following functions:

  • Gracefully kills all processes
  • Saves and closes all open system-related files.
  • Waits a specified number of seconds before actually shutting down
  • Provides a warning to all users on the system that the computer will be 'going down' at the appropriate time, giving them the opportunity to save their work and exit the machine.
  • Unmounts all filesystems (not all Unix/Linux systems do this)
  • Sets the machine to the correct run level.

INIT 0

Init 0 is one of the commands run by shutdown itself. Init is one of the applications launched by most Unix and Linux systems to start processes. The INIT 0 command sends the run level 0 to the INIT command, telling it to power the system down. Like Shutdown, INIT gracefully kills processes, then synchs the filesystems and then (on some systems) unmounts filesystems. Next, INIT changes the run level immediately after accomplishing these tasks. Users get no warning.

HALT

The halt command shouldn't be used except in emergencies. It doesn't synchronize the file systems, and it doesn't worry about killing processes, it just halts the system and exits the Unix operating system. This can leave you with several problems ranging from lost data to corrupt files.

STOP-A / CTRL-ALT-DEL etc.

(hardware dependant)

Every system has it's magical keyboard command that will halt the system. On a Sun machine, this is STOP-A (or L1-a on some keyboards). On Intel based architectures, this is CTRL-ALT-DEL. This command causes the GUI to exit, then Unix to immediately halt and exit, losing all data, leaving the file system in chaos and generally wreaking all kinds of havoc, and dumping the user to a low-level command prompt (PROM in the case of Sun machines, or a DOS-like interface on Intel based systems).


Bookmark this page and SHARE:  

Search

Support InetDaemon.Com

Get Tutorials in your INBOX!

Free Training

Free Training