View and change the running level in linux

Source: Internet
Author: User
Article Title: View and change the running level in linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Linux runs from 0 ~ 6, a total of 7.

0: Shut down. The default running level of the system cannot be set to 0. Otherwise, the system cannot be started.

1: in single-user mode, only root users are allowed to maintain the system.

2: multi-user mode, but NFS cannot be used (equivalent to network neighbors in Windows)

3: multi-user mode on the Character interface.

4: undefined.

5: multi-user mode of the graphic interface.

6: restart. You cannot set the default running level to 0. Otherwise, the system will be restarted.

View running-level commands:

Runlevel

Displays the last and current running level of the system. If the previous running level does not exist, N is used.

Change the running-level command:

Init [0123456]

About running level

This question seems to have nothing to do with the topic of this article, but now more and more linux beginners are encountering problems with the linux graphic interface, and these problems are also involved in the Chinese Input Method setting process, so I 'd like to mention it by the way.

After the current linux installation is complete, it runs at the 5th system running level by default. In the system v-style unix system, the SYSTEM is divided into different running levels, which is different from the UNIX of the BSD branch, commonly used as 0 ~ 6. Seven levels:

0 Shutdown

1 single user

2. Multiple users without Networks

3. Multiple users with networks

4 reserved, user-defined

5. Multiple users in the graphic interface

6. restart the system

Since the current Linux system runs at 5th levels after installation, that is, the system directly enters the graphic interface after startup, instead of starting the graphic interface with startx or xinit after logon in character mode. This looks very convenient. But what are the disadvantages? Once you have changed some settings and displayed problems, the system keeps sending tokens between graphics and characters. It is very troublesome for new users to learn how to deal with them, and for those who study Linux, this is not conducive to understanding and learning some underlying Linux things. Old users who have used Linux for a long time know that in the past, Linux such as redhat6.0 had a default running node of 3. Even if RedHat9.0 was later installed, they can select the default character logon or graphical logon. However, the current fcseries and most other versions directly allow users to directly log on to the GUI regardless of November 21. Although Linux is becoming easier for most cainiao, there is a lot of fun and new users cannot experience it.

Maybe you don't believe that there are many problems when you log on to the system directly using graphics. We recommend that you set the default running level of the system to 3rd after the system is installed. After logging on to the character terminal, then manually enter the startx command to start the graphic interface. You can modify it as follows:

Use a text editor to modify the/etc/inittab File

Code:

Id: 5: initdefault: This line is modified

Code:

Id: 3: initdefault: reboot restarts after saving, and the system starts to the character interface by default. The difference between different running levels is that the system starts services by default. For example, Level 3 does not start the x gui service by default, but Level 5 is started by default. There is no difference in nature, and it doesn't matter whether the functions of different levels are strong or not. Users can define different levels of default services on their own. At any running level, you can use the init command to switch to another running level.

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.