Shutdown, halt, reboot, and init

Source: Internet
Author: User

Shutdown, halt, and reboot are actually sending signals to initProgramTo change the runlevel ..
Runlevel 0 is used to stop (halt), and halt is used to call shutdown-H
Runlevel 6 is used to reactivate the [reboot] system.
Runlevel 1 is used to bring the system into the state where management work can be performed.
Init defines eight runlevels. init 0 indicates shutdown, and init 1 indicates restart.

Before saving the disk, the Linux Process performs swap on the data and writes the data to the hard disk when the system is idle. this is why the hard disk is written in Linux when the system is idle. this is where the problem occurs. When the system loses power, it is too late for the system to synchronize the data in the SWAp partition to the hard disk. As a result, the system integrity is damaged.

Appendix

1. Shutdown parameters:

Before changing to another runlevel, tell init how long it will take to shut down.
Restart the calculator.
It does not actually shut down, but it only sends a warning signal to each login 〕.
Turn off the power after Shutdown (halt 〕.
You don't need to use init, but shut down it yourself. You are not encouraged to use this option, and the consequences of this option are not always what you expected.
Cancel current process cancels the currently executing Shutdown program. Therefore, this option certainly does not have a time parameter, but you can enter a message for explanation, and this information will be sent to each user.
Ignore fsck when restarting calculator [reboot.
Force fsck when restarting calculator [reboot.
Set the time before shutdown.

2. Halt
In fact, halt calls shutdown-H. When halt is executed, the application process is killed and the sync system call is executed. After the file system write operation is completed, the kernel is stopped.
Parameter description:
Prevent the sync system from calling. It is used after fsck is used to patch the root partition to prevent the kernel from overwriting the patched super block with the old version of superblock.
It is not a real restart or shutdown, but a record for wtmp (/var/log/wtmp.
Do not write the wtmp record (included in the options 〕.
Force shutdown or restart without calling shutdown.
Disable all network interfaces before shutting down (or restarting.
This option is the default option. It is called poweroff when shutdown.

3. Reboot
The reboot process is similar to that of halt, but it causes host restart, while halt is shutdown. Its parameters are similar to those of halt.

4. init
Init is the ancestor of all processes, and its Process number is always 1. Therefore, sending a term signal to init will terminate all user processes and daemon processes. Shutdown uses this mechanism. Init defines eight runlevels. init 0 indicates shutdown, and init 1 indicates restart.

In addition, the telinit command can change the running level of init. For example, telinit-Is can enable the system to enter the single-user mode, and the information and waiting time when shutdown is not available.

 

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.