Solve the problem of not starting the desktop service when Cento is started.
If Centos is not started, you can change the system running level to enter the CentOS page.
Input
# Init 3
View running level
# Runlevel
53
# The current running level of the system is "5" and the last running level is "3". The conversion operation level is successful.
Detailed description
The Linux system runs on a specified running level at any time, and different running-level programs and services are different. The work to be done and the purpose to be achieved are different. Centos sets the running level as shown in the following table, and the system can switch between these running levels to complete different tasks. Running description
0. All processes will be terminated, and the machine will be stopped in an orderly manner. when the machine is shut down, the system will be in this running level.
1. single-user mode. Used for system maintenance. Only a few processes run and all services are not started.
2-user mode. Like Level 3, the Network File System (NFS) service is not started.
3 multi-user mode. Allows multiple users to log on to the system, which is the default startup level of the system.
4 left to the user's custom running level
5-user mode. After the system is started, run X-Window to provide a graphical logon Window.
6. All processes are terminated and the system restarts.
1. if you enter the character logon CentOS page after the system starts, the default running level is 3. If you enter the graphical logon CentOS page after the system starts, the default running level is 5.
2. If you have enabled the CentOS page, you can run the following command to access the CentOS page:
$ Startx &
View and switch at run level
You can use the following command to view the running runlevel of the current system. You can use the following command to switch the running level init [0123456Ss], that is, the init command is followed by a parameter, this parameter is the runtime code to switch to, for example:
Use the init 0 command to switch to the running level 0, that is, shut down (do not set initdefault to 0)
Use the init 1 command to switch to running Level 1, that is, enter the single-user running mode
Use the init 6 command to switch to running Level 6, that is, restart (do not set initdefault to 6)
You can also use the te linit command. In CentOS, the te linit command is the symbolic link of the init command.
The following is an example of using the runlevel and init commands:
# Display the current running level of the system
# Runlevel
N 3
# The current running level of the system is "3", not the last running level (represented by "N)
# Init 2
# After the "init 2" command is executed, the system console displays the information about stopping the service.
# Runlevel
3 2
# The current running level of the system is "2" and the last running level is "3". The conversion operation level is successful.
Therefore, change the running level of inidefault in/etc/inittab to 2 or 3 to disable the desktop service.