The UNIX operating system is one of the most frequently used operating systems on the network, and using UNIX systems, the machine is much more complicated than the shutdown process using a DOS Single-user machine. If you do not use the correct shutdown command and shutdown method under UNIX, the file system will be destroyed, causing great loss. Here are five ways to shut down UNIX systems.
1, with haltsys command shutdown
Once the Haltsys command is issued, the system will be shut down immediately. The advantage is that the system response is fast and compelling, so the command is only suitable for a single user on the system. If more than one user is working on the system, the user is forced out of the system as soon as the command is issued, and their process is lost. The Operation method is: The super User login, input haltsys, enter, the system displays the shutdown information, turn off the power.
2, with reboot command shutdown
The reboot command is a shutdown program executed by the system administrator, reboot essentially linked to the Haltsys command. The only difference between reboot and Haltsys is that it automatically boots and restarts the system without pressing any key after normal downtime. Reboot is especially suitable for system administrators to debug machines.
3, with shutdown command shutdown
The Shutdown command is a program written in the shell language that resides in the/ETC directory. It is run by the super user in the foreground, automatically executes the wall command, notifies all users who are working in the system, the system will be shut down within the specified time, prepare and then log off from the system. When all users have been logged out of the system or the specified time has arrived, shutdown executes the KILL command to terminate all processes except the console in the system, and then executes the Haltsys command to shut down the system normally. Use format: Shutdown-g[hh:]mm-f "MESG", where [hh:]mm is the system designated shutdown time, "MESG" is the system to each end user sent information. It is recommended that you use the shutdown command to shut down the computer in network users.
4, with bye command shutdown
Bye command is to shutdown as the core, with VI edit generated SHUTDOWN command, the main advantage is simple and easy to remember. Bye file content is: shutdown-y-g0 (parameters can be set according to the actual needs), after editing the bye permission for-rw-r-r-, at this time bye can not be used directly, the permission to let go, # chmod u+x can only exercise Bye,bye function.
5. Create shutdown user bye
The use of power users to shut down, not conducive to the management of the system, there are certain security risks, it is necessary to establish automatic shutdown users. The following is the SYSADMSH command to create a shutdown user bye.
(1) Create bye user. Log on to UNIX with Superuser, type Sysadmsh, select Account->user->create, enter in username: bye, other defaults.
(2) in Account->user->examine, enter bye and select Privilege->subsystem->specify input shutdown, save modification information and exit Sysadmsh.
(3) register with bye to UNIX, edit the. profile file under the current directory. The contents of this file are:
Trap Exit 2,3
/tcb/bin/asroot shutdown-y-g0
(4) In login: state, the UNIX operating system is automatically turned off as long as you type bye.