Linux system shutdown and restart

Source: Internet
Author: User

There are shutdown, halt, reboot, and Init in the Linux Shimonoseki and reboot system, for whom their internal working process is different.

1. Shutdown command

It can be used to safely shut down the system, but when the system is shut down, all logged-in users will be notified that the system will be closed and all instructions will be frozen, that is, all new users will not be able to log in again, and that the instruction may be shut down or restarted immediately and delayed for a period of time. (Note: Only Superuser can use this command)

Command syntax format:

shutdown [options] [TIME] [warning message]

The meaning of each of the options in this command is explained:

-K: Just send a warning message to the user

-R: Rebooting the system after shutting down the system

-H: Do not restart the system after shutting down the system

-F: Quickly shuts down the system, but does not perform disk detection when rebooting the system (discovering that the system entered the BIOS interface during the experiment, but cannot do anything)

-N: Close the system quickly, but not through the INIT program

-C: Interrupt shutdown system (no specific test found)

2. Halt command

Using the halt command is to invoke the "shutdown-h" command to execute the shutdown system

command syntax format;

Halt [Options]

-W: Not really shut down the system, just write "wtmp" (/var/log/wtmp) record

-D: Do not write "wtmp"

-F: "Shutdown" is not called but forced to close

-I: Turn off all network UO interfaces before shutting down the system or rebooting the system

-P: This option is the default option to invoke "power off" when shutting down the system

3. Reboot command

The reboot command works in a similar way to the halt command, but reboot initiates a host restart. All of its parameters are similar to "halt".

4. Init command

The init command uses the system's operating level control system. It is the ancestor of all system processes, its process number is always 1, so send "term" signal to INIT will terminate all user processes and daemons, etc., "shutdown" is the use of this mechanism. Init 0 is the shutdown system, init 1 restarts the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.