Analyzing the running level and startup mechanism of Linux system

Source: Internet
Author: User

One system run level

The Windows system has a safe run mode and normal operating mode, which is two different run levels, and Linux also has a system run level, and the Linux system runs at a more flexible and diversified level.

Before telling the run level, let's start with the INIT program under Linux, because the INIT program is directly associated with the system run level, and the INIT program is one of the most important programs of the Linux operating system and is a user-level process initiated by the system kernel. The init process is also the originator of all other system processes, meaning that the init process is the first process that the system runs, and its process number is always 1.

The Linux system has 7 running levels, which are specified in the/etc/inittab file, and are described below for the specific implementation of the/etc/inittab file.

Take Redhat Linux For example, the following is a piece of information from/etc/inittab.

# Default RunLevel. The runlevels used by RHS are:

# 0-halt (Don't set Initdefault to this)

# 1-single User mode

# 2-multiuser, without NFS (the same as 3, if you don't have networking)

# 3-full Multiuser mode

# 4-unused

# 5-x11

# 6-reboot (Don't set Initdefault to this)

The above information lists 7 running levels of Linux systems:

0-shutdown mode,

1-single-user mode, single user only system administrator can log in.

2-multiuser mode, but does not support file sharing, for example, does not support NFS services. This pattern is not commonly used.

3-Full multiuser mode, support for NFS services. The most commonly used user mode, default login to the system's character interface.

4-Basic User mode, you can implement some specific login requests.

5-Full multi-user mode, the default login to the X-window system, that is, login to the Linux graphical interface.

6-reboot mode, which is to perform shutdown of all running processes, and then reboot the system.

These run levels correspond to the INIT programs in Linux, such as the execution of the Init 1 system into Single-user mode, and the execution of the Init 6 system restarts.

All lines that begin with # in the Inittab file are comment lines. Comment Lines help users understand the specific meaning of each item in the Inittab file, and the values in the Inittab file are composed of the following formats:

1. Label Field

A label is a 1~4 of characters that are used to indicate the value entered. Some systems support only 2-character labels. For this reason, most people limit the number of label characters to 2. The label can be a string of any character, and the tags used in red Hat Linux are:

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.