Summary of five methods for normal shutdown of UNIX systems

Source: Internet
Author: User
This section describes the five methods for normal shutdown of UNIX systems-general Linux technology-Linux technology and application information. The following is a detailed description. Release date: 2009.06.17 Source: SCID Author: heart with wind

[Ccid it technology report] UNIX operating system is currently one of the most widely used operating systems on the network. It is much more complicated to shut down a computer on a UNIX system than to shut down a single user computer on a DOS system. If you do not use the correct shutdown command or method in UNIX, the file system will be damaged, causing great losses. The following describes five shutdown methods for UNIX systems.


1. Shut down with the haltsys command


When the haltsys command is issued, the system is immediately shut down. The advantage is that the system responds quickly and is forced. Therefore, this command is only applicable to scenarios where the system has only one user. If multiple users are working on the system, they are forced to exit the system as soon as they issue commands, and their processes are lost. The operation is as follows: Log On As a Super User, enter haltsys, and press Enter. When the system displays the shutdown information, turn off the power.


2. Use the reboot command to shut down


The reboot Command is a shutdown Program executed by the system administrator. The reboot command is essentially linked with the haltsys command. The only difference between reboot and haltsys is that it automatically directs immediately and restarts the system without pressing any key after normal shutdown. Reboot is especially suitable for system administrators to debug machines.


3. Use the shutdown command to shut down


The shutdown command is a program written in shell language and resides in the/etc directory. It is run by the superuser on the front desk and automatically runs the wall command to notify all users who are working in the system that the system will be shut down within the specified time. Please be prepared, then, log out from the system. When all users have logged off from the system or the specified time has been reached, shutdown will execute the kill command to terminate all processes in the system except the console, and then execute the haltsys command to shut down the system normally. Format: shutdown-g [hh:] mm-f "" Mesg "", where [hh:] mm indicates the shutdown time specified by the system, "Mesg" is the information sent by the system to various end users. The shutdown command is recommended for network users.


4. Run the bye command to shut down the instance.


The bye command is centered on shutdown. It is easy to remember to edit the generated shutdown command with vi. The content of the bye file is shutdown-y-g0 (the parameter can be set according to actual needs), and the edited bye permission is-rw-r-. In this case, bye cannot be used directly, open the permission, # chmod u + x bye, and bye can be used to perform the shutdown function.


5. Create a shutdown user bye


Shutdown with super users is not conducive to system management and has certain security risks. Therefore, it is necessary to establish an automatic shutdown user. Run the sysadmsh command to create the shutdown user bye.


(1) create a bye user. Log on to UNIX as a Super User, type sysadmsh, select Account> User> Create, and enter bye in Username.


(2) In Account-> User-> Examine, enter bye and select Privilege-> Subsystem-> Specify and enter shutdown to save the modification information and exit sysadmsh.


(3) Register UNIX with bye and edit the. profile file in the current directory. The file content is:


Trap exit 2, 3


/Tcb/bin/asroot shutdown-y-g0


(4) In the Login status, as long as you type bye, the UNIX operating system is automatically disabled.


Edit responsibility: Zhang ?? (Internship)
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.