System Shutdown

 < Day Day Up > 

What does it mean to shut down the system? Well, in its simplest form, a shutdown of the system simply means issuing the /sbin/shutdown command. The shutdown command terminates all processing. It has many options, including the following:

-a

Use /etc/shutdown.allow to determine whether a user is authorized to shut down the system.

-t sec

Wait for sec seconds before sending processes the warning and the kill signal and changing run levels.

-r

Automatically reboots the system; that is, brings it down and brings it up.

-h

Halts the system completely.

time

Specifies the time at which to shut down in hh:mm, +m for the number of minutes to wait, or now for immediately.

-F

Force fsck on reboot.

-f

Skip fsck on reboot.


If you issue a shutdown -h, the halt command is called by shutdown. You can also call halt directly if you want. (Note that if halt or reboot is called when the system is not in runlevel 0 or 6 (when its running normally), shutdown will be invoked. For more information, see the shutdown or halt man pages.)

Here are some of the things your system does when you issue the shutdown -h or halt command:

  • Logs the shutdown operation (in /var/log/wtmp).

  • Kills nonessential processes.

  • Executes the sync system call (sync flushes the filesystem buffers, forcing any changed blocks to disk and updating the superblock).

  • Waits for filesystem writes to complete.

  • Halts the kernel.

  • halt -n prevents the sync system call from taking place when used by fsck after a repair to the root partition.

To shut down and automatically reboot the system, you would type

 $ shutdown -r now 

To halt the system, you would type

 $ shutdown -h now 

To shut down the system in two minutes, type

 $ shutdown -h 120 

You do have ways other than shutdown to bring down the system. You can issue halt, which was already mentioned, reboot, or poweroff. If you want to bring down your system, I strongly recommend using shutdown because it provides a secure smooth transition to differing run levels, or to power down the system.

     < Day Day Up > 


    Linux on HP Integrity Servers. A System Administrator's Guide
    Linux on HP Integrity Servers: A System Administrators Guide
    ISBN: 0131400002
    EAN: 2147483647
    Year: 2004
    Pages: 100

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net