Linux shutdown commands and differences

Source: Internet
Author: User
A user's SUSE10 machine has been unable to restart recently and has been stuck on the restart interface. neither init0 nor shutdown-hnow can be used. in the end, halt can be used to shut down again. in linux, some common shutdown/restart commands include shutdown, halt, reboot, and init ,...
Recently, the customer's SUSE 10 machine has been unable to restart and stuck on the restart interface. neither init 0 nor shutdown-h now works. in the end, halt can be used to shut down again. in linux, some common shutdown/restart commands include shutdown, halt, reboot, and init, which can be used to restart the system. However, the internal working process of each command is different, through the introduction in this article, we hope you can use various shutdown commands more flexibly. 1. shutdown www.2cto.com the shutdown command safely shuts down the system. It is very dangerous for some users to disable linux by directly disconnecting the power supply. Since linux and windows run many processes in the background, forced shutdown may lead to data loss in the process? Make the system unstable? In some systems, hardware is damaged. And use the shutdown command before the system is shut down? The system administrator notifies all logged-on users that the system will be disabled. And the login command will be frozen? That is, new users cannot log on again. Is it possible to directly shut down or wait for a certain period of time to shut down? It may also restart. This is determined by the signal that all processes receive from the system [signal. Does this allow programs like vi to have time to store the files currently being edited? Programs such as mail and news can leave normally. Shutdown is to send a signal [signal] to the init Program? It is required to change the runlevel. Runlevel 0 is used to stop [halt 〕? Is runlevel 6 used to reactivate the [reboot] system? Runlevel 1 is used to bring the system into a state where management work can be performed? Is this preset? Assume that no-h or-r parameter is set to shutdown. Do you want to know what actions are performed during the shutdown (halt) or re-boot (reboot) process? You can view the runlevels related information in the/etc/inittab file. Shutdown parameter description: [-t] before changing to another runlevel? Tell init how long it will take to shut down. Www.2cto.com [-r] restart the calculator. [-K] isn't it true to shut down? Only a warning signal is sent to each login 〕. [-H] power off after shutdown [halt 〕. [-N] no init? Instead, shut down the server by yourself. Are you not encouraged to use this option? In addition, the consequences of this option are not always what you expected. [-C] cancel current process cancels the currently running shutdown program. So this option certainly does not have a time parameter? But can I enter a message for explanation? This information will be sent to each user. [-F] ignore fsck when restarting calculator [reboot. [-F] forces the fsck when restarting the calculator [reboot. [-Time] set the time before shutdown. 2. halt-the simplest command to shut down halt is to call shutdown-h. When halt is executed? Killing an application process? Execute sync system call? After the file system writes, the kernel is stopped. Parameter description: [-n] prevents sync system calls? After fsck is used to fix the root partition? To prevent the kernel from overwriting the repaired superblock with the old version of superblock. [-W] isn't it a real restart or shutdown? Write the wtmp (/var/log/wtmp) record. [-D] do not write the wtmp record [included in option [-n 〕. [-F] force shutdown or restart without calling shutdown. Before www.2cto.com [-I] shutdown [or restart? Disable all network interfaces. [-P] This option is the default option. It is called poweroff when shutdown. 3. how does reboot work like halt? But does it cause host restart? While halt is shut down. Its parameters are similar to those of halt. 4. is init the ancestor of all processes? Its process number is always 1? So sending the TERM signal to init will terminate all user processes? Daemon. Shutdown uses this mechanism. Init defines eight runlevels, and init 0 indicates shutdown? Init1 indicates restart. Can init be a long story? This is not described here. In addition, can the telinit command change the init running level? For example? Does telinit-iS enable the system to enter single-user mode? The shutdown information and waiting time are not available. Author: snilwong
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.