Linux shutdown steps and precautions (suitable for servers)

Source: Internet
Author: User
For the Linux system shutdown steps and precautions (suitable for servers)-Linux Enterprise Application-Linux server application information, see the following for details. Author: xwg999

On QQ, a netizen sent a message saying that Linux was suddenly powered off and data was not saved. How can we ensure that everyone's data is saved to the hard disk in the Enterprise? This reminds me of the difference between windows and windows. to shut down the server, if someone connects to a windows server to access data, windows will prompt someone to connect to the current server, so that we can notify users to prepare for data storage, so Linux is not so intelligent. We need to manually prompt users.

With regard to the Linux shutdown process, most users think that shutdown-h now is all right. In fact, the shutdown of Linux is also worth your attention, let's talk about some work to be done during the shutdown process!

1. check that the current online staff can use the who command to know who is using Linux resources. This generally refers to remote Logon (Telnet or SSH) to operate Linux Hosts.

2. check who is connected to the host. You can use the netstat command. The usage is generally as follows:
1. netstat-a displays the status of all services provided by the local machine. After the service is displayed, LISTEN indicates the service being monitored.
2. Based on netstat-an, you can view which ports are in use.

3. synchronize data to the hard disk. Generally, Linux runs the sync command once every 30 seconds to write data in the memory to the hard disk.

In Linux, in order to speed up data reading, in some cases, some data is not directly written to the hard disk, but is temporarily stored in the memory, if the data is repeatedly called or rewritten, it is read directly from the memory because it is not written to the hard disk, and the speed is quite fast, if the data is not stored, restart, shut down, or suddenly shut down, the consequences can be imagined. Therefore, the sync command is required for data synchronization and writing when the instance is restarted or shut down. If you enter sync, data that has not been saved in the memory will be written to the hard disk instead of the original version, therefore, before the system is shut down or restarted, it is best to execute this command. Generally, the command must be executed several times more than three sync commands.

4. Finally, execute the corresponding command to execute the corresponding action.

Shutdown command: shutdown
Restart: reboot
Direct shutdown: halt

Note: shutdown can also send a warning message to the Login User: # shutdown + 5 "System will shutdown after 5 minutes" means that the shutdown will take 5 minutes after the notification is sent.
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.