"2016-10-11" Linux systems common shutdown or restart commands shutdown, reboot, Halt, Poweroff, Init 0, and init 6 connections and differences

Source: Internet
Author: User

Common shutdown/Restart commands under Linux typically include:

Shutdown, reboot, Halt, Poweroff and so on, of course we can use Init run level RunLevel 0 that is halt to shut down, or use init run level RunLevel 6 that is reboot to perform a reboot.

Of course, there are some subtle differences in the way these shutdowns or restarts are made.

First, make clear that the RunLevel operating level of the Linux/redhat system is different from the runlevel of the Debian system.

The runlevel of the Redhat system is defined as follows:

RunLevel 0:halt system down state, the default operating level of the system cannot be set to 0, otherwise it will not start normally

RunLevel 1:single User single users working status, root privileges, for system maintenance, prohibit remote login

RunLevel 2:multiuser without network multi-user state (no NFS)

Runlevel3:multiuser full multiuser State (with NFS), enter console command line mode after login

Runlevel4:unuse system not used, reserved

runlevel5:x11 X11 Console, enter GUI mode after login

Runlevel6:reboot system shutdown and restart, the default run level cannot be set to 6, otherwise it will not start normally

In Debian/ubuntu, RunLevel is defined as:

0-halt

1-single

2-full Multi-User with Display Manager (GUI)

3-full Multi-User with Display Manager (GUI)

4-full Multi-User with Display Manager (GUI)

5-full Multi-User with Display Manager (GUI)

6-reboot

You can see that there is no difference in the 2~5 level.

Ubuntu system has a default runlevel of 2.

Therefore, we can perform the halt shutdown using init, and execute the reboot using init 6来.

In fact, the shutdown command is also done after a series of operations, such as closing the process/service one by one, call sync to write data to disk, and then call Init0 or INIT6 to perform shutdown or restart.

And halt is actually called shutdown-h now, can ignore the system's current state and directly shut down, but in some systems, halt will not power off, and only shut down the OS.

Here's a brief summary of how these commands are used.

"2016-10-11" Linux systems common shutdown or restart commands shutdown, reboot, Halt, Poweroff, Init 0, and init 6 connections and differences

Related Article

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.