Correct shutdown method in Linux

Source: Internet
Author: User
Correct shutdown in Linux method 1 prepare before shutdown 11 observe system usage status 12 notify online users shutdown time 2 shutdown command 21sync22shutdown23reboot24halt25poweroff3 execute level 31 levels 32 levels switch 1 prepare Linux to shut down correctly before shutdown method 1 prepare 1.1 observe system usage status before shutdown 1.2 notify online users of shutdown time 2 shut down command 2.1 sync2.2 shutdown2.3 reboot2.4 halt2.5 poweroff3 execute level 3.1 Classification 3.2 level switch 1 prepare 1.1 observe system before shutdown who is online: who network status: netstat-a program executed in The background: ps-aux1.2 notifies online users of shutdown time + 2 "The machine will shutdown" # shutdown after 2 minutes, notify the online user 2 to shut down the command 2.1 sync to write data not written to the hard disk in the memory to the hard disk 2.2 shut. Downshutdown now # shutdown now + 2 # shutdown after 2 minutes shutdown at # shutdown at + 2 "The machine will shutdown" # shutdown after 2 minutes, and notify the online user to restart 2.3 reboot. after adding parameters, the user can implement halt. the connection of poweroff2.4 halt to reboot is equivalent to the connection of shutdown-h 2.5 poweroff to reboot, equivalent to halt 3 execution level 3.1 Classification run level 0: Shutdown run level 3: Plain text mode run level 5: including graphic interface mode run level 6: restart 3.2 level switch init 0 # switch to level 0, that is, shutdown attached: shutdown, halt, poweroff difference Answer-text MB-10 code shutdown: Shut down the system. refer to the existing explanation: "The 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 be restarted. 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 exit normally. "shutdown will execute the scripts in/etc/rc0.d, that is to say, the runlevel 0 script will be executed. Halt does not. Poweroff: turning off the system power. poweroff is just the soft link of halt. The halt command is executed. The halt command can be understood as follows: halt calls shutdown-h. When halt is executed? Killing an application process? Execute sync system call? After the file system writes, the kernel is stopped.
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.