Linux starts init to control six login Modes

Source: Internet
Author: User
Init is the root process in Linux and the ancestor of all processes in the system. It is mainly used to generate processes based on a script program recorded in the etcinittab. This file is usually used to control the user logon mode. Valid logon modes for Linux are 0 ~ 9 there are 10 types, but there are at most 6 Restrictions On UNIX systems, generally only 1 to 6

Init is the root process in Linux and the ancestor of all processes in the system. It is mainly used to generate processes based on a script program recorded in the/etc/inittab. This file is usually used to control the user logon mode. Valid logon modes for Linux are 0 ~ There are a total of 10 types, but the limits of up to 6 types of UNIX systems are used, generally only 1 to 6 are valid.

Init generally runs automatically when the system starts. It can also be called by the root user. It is used to switch the running status of the system. ItsCommandThe format is init NUM <press enter>. NUM indicates any number ranging from 1 to 6.

Two of the six modes are determined by the system:

0: Stop the system. Init 0 <press enter> is equivalentHalt<Press enter> 〉.

6. restart the system. Init 6 <press enter> is equivalent to reboot <press enter> 〉.

If you know the/etc/inittab file, do not set 0 to the default logon mode. Otherwise, your Linux operating system will only have 2.1 lines-boot success → shutdown, or an infinite loop of reboot → restart. The other four modes are determined by the operating system. If you are willing to modify the source code of Linux, you can also define the actual functions of these four (or even six) modes. In fact, it is enough to know the conventions of the Linux release vendor. Let's take the blue point 2.0 as an example to see the common conventions of init --

Init 1 -- enter single-user mode. This is the same as choosing Safe Mode when starting the system. You can manage the system with root permissions, but cannot enter the graphic Mode or Chinese characters, sound cards and network services are not required. In short, it is the minimum software and hardware configuration that the system can run. It is similar to the Windows security mode, but the essential difference is that as long as you run the corresponding commands in Linux, hardware devices can be driven in this mode. For example, you only need the correct optical drive connection, one mount/dev/CdRom command to read the content of your cd at any time in/mnt/cdrom. Note that the character console in this mode cannot support Chinese characters, but you can still see the beautiful Chinese font on the blue dot in Xwin mode, and the input method is completely correct.

Init 2 -- enter the multi-user mode without network services. If your computer has no network connection, this mode will be the same as the normal mode. Otherwise, others will not be able to access the www,FtpOr teLnEt has logged on to your computer,PingCommands on your computer will still respond. If the ping command is rejected, we recommend that you unplug the network cable! If your computer acts as a network server, this mode will be quite useful. For example, if you want to refresh the system or update the website content, you can adjust the computer to this mode and perform your work with confidence, after the work is completed, switch to Mode 3 or 5. Note that if you already have an ftp orTelnetAfter entering your system, init 2 cannot interrupt the connection between him and you. Be careful to let others blacklist you at this time! -- Run init 2 firstWhoCommand to check it. In this mode, the usage on the local machine remains unchanged. You can still access the network, the Internet, ftp, or telnet to any server in the network. Your computer does not provide services to other machines on the network. When the computer is transferred from 3rd running level to this mode, you will see a series of network services stopped.

Init 3 or init 4 -- logon to the console in multi-user mode. This is the default logon mode of blue point 1.0, every user must log on from the black and white screens before they can run startx to enter the KDE world. After Xwin is started, the console that runs startx will be locked, unless you use startx & to run Xwin in the background. To use C in another consoleTrL + Alt + F *, * indicates any one of the numbers 1 to 6, ctrl + Alt + F7 then return to the graphics mode dedicated 7 Console (sometimes use Ctrl + Alt + F8 ). If you switch from init 1 or init 2 back to init 3, we can see that a series of services are restarted.

Init 5 -- enter the multi-user mode for graphical login. This is the default startup mode after Blue Point 2.0 is installed. After the system starts or runs the init 5 command, a beautiful logon window appears on the blue-green transition background. All account names are displayed in the window as icons, so you do not have to enter them yourself. However, the system administrator may be unhappy-isn't it clear how many users in the system? However, modification in the KDE control center can solve the problem. If a problem occurs in the system, you can still enter this interface as long as the system is started (indicating that there is no problem with the X server). The root account can also enter the Linux security mode from here, in the lower-left selection box, change the mode from kde to save fail.EdThat's all. Of course, the interface is definitely not beautiful, but it is essential to fix the problems of the X Window Manager or application.

When the login window appears, the console from 1 to 6 is often locked. However, after a user successfully or fails to log on to the console, the console from 1 to 6 becomes available. Is it a bit confusing? Sometimes you have to press a few more keys or even Ctrl + C after switching. Now let's solve the second problem mentioned at the beginning of the article-there are two methods: the traditional method is to run the rootSetRun the up command to reconfigure the X Window System and specify that the image mode is not automatically entered when the system is started next time. Alternatively, go to one of the following methods on the console, enter init 3 <press enter>. The graphic logon window disappears from the console 7. You can use startx to log on to the system.

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.