Sunday, March 27, 2011

There are techniques for the Linux operating system shutdown

III. analysis of the Shutdown command.

Because Linux is a multiuser system. At the same time there may be multiple users log on this system. Such as through SSH commands to remote login, etc. The system administrator may want to turn off before to the current Linux system with all of the logged-on user issues a warning. Or in ten minutes after shutting down the system and so on. If the system administrator to implement this functionality, you need to use the shutdown command to shutdown. Shutdown command, you can safely turn off or restart Linux system. This command will close the system to the system before all the logged-on user (including remote login user) prompt a warning message. This command also allows system administrators to specify a time parameters, within the prescribed time after shutting down the system. As can be a precise time (how long something) or start of a period of time (ten minutes). Use this command all the processes on the system will receive a SIGTERM signal. This would have the advantage. It can make the text editor vi, and so has the time to be in edit State files. Mail and news, application process, you can move all the data in the buffer pool for proper cleanup, etc. So this is a very user-friendly shutdown command. System administrator run the shutdown command, the system notifies the init process that requires it to change run level to implement a specific functionality. Run level 0 to turn off the system run level 6 is used to restart the system to run level 1 is used to enable the system to perform system administration tasks. If you do not give the-h or-r parameter, this is the default shutdown command. System after the execution of the order, automatically synchronizing data. So this command takes a little longer may be. But if you consider data synchronization, then the administrator, so time is worth it. Here refers to a run-level concepts, it is a Linux system and Windows system differences larger one point. The so-called run level is a system software environment configuration. In a specific environment only allows a group of selected processes exist. Init to different run level is derived from the process. Init can boot into eight different run level, including 0-6 run level and S or s runlevel. Run levels can be superuser by telinit command to convert. This command converts signals can be passed to init, tell it to switch to which run level. Run level 0, 1 and 6 for the system to run level reserved private. Run level 0 is used to shutdown, run level 6 is used to restart, run level 1 is used to put the computer into single user mode. Runlevel S is not used directly to us, more is to enter runlevel 1 run some executable script is called. In this command, you can join different parameters for different purposes. If shutdown-k command, and not a true shutdown, but simply send a warning signal to each logon users (including remote login). The system administrator shuts down the system before you use this command to tell the other users logged on, is a good practice. In addition, sometimes Linux system as Windows system, the system shut down and turn off the power supply is not active. You can use the command shutdown-h, clearly indicates that the system to turn off the power at the same time after power off. Note that this command and halt shutdown commands, called getuid system processes to determine whether the current user as root user. If Yes, continue with the following shutdown actions; if the current user as a normal user, you exit the command directly.

No comments:

Post a Comment