What steps do you need when Linux starts? This article will describe the role of different running levels in the startup.
Linux seems to be a monster for advanced users under the DOS / WIN9X / NT platform. No confi
g.sys, no
Autoexec.bat, machine configuration with personal characteristics doesn't know where you start.
It should be noted that many people think that Linux is a clone of UNIX, but this statement is not Linux.
Fair. Linux
More open than UNIX, more powerful. We should call GNU / Linux.
When Linux starts, run a program called InIT, then start the following tasks, including multi-user ring
Square, network, etc.
So what is the run level? Simply put, the run level is the functional level of the operating system is currently running.
. This level ranges from 1 to 6,
Has different functions. These levels are specified in the / etc / inittab file. This file is init program looking for
Main file, first run
Services are files that are placed in the /etc/rc.d directory.
In most Linux release, the startup script is located in /etc/rc.d/init.d. These scripts
Connected to the /etc/rc.d/rcn.d by the ln command. (Here the N is running grade 0-6)
For example /etc/rc.d/rc2.d, the S10Network below is connected to the NetWork feet under /etc/rc.d/init.d.
Ben.
Therefore, we can know that the files below RC2.D are related to running level 2.
The START starting is that START is the meaning of the startup service, and the number 10 after the latter is the order of the startup. E.g,
In the same directory,
You can also see the S80Postfix file, 80 is after 10, because there is no start of the network
In the case of starting postfix
There is no effect.
Look at /etc/rc.d/rc3.d, you can see the file S60NFSLOCK, but this file does not exist / etc /
Rc.D / rc2.d directory.
NFS To use this file, it is generally used in a multi-user environment, so put it in the RC3.D directory.
In addition, you can also see files starting with K starting in /etc/rc.d/rc2.d, for example
/etc/rc.d/rc2.d/k45named, k on behalf of KILL.
Standard Linux runs 3 or 5, if it is 3, the system is in multi-user status. If it is 5,
It is Run X Window
system. If you are currently 3 or 5, and if you reduce the run level to 2, init will execute the K45named script.
.
Different run levels are as follows: (You can refer to the / etc / inittab in Red Hat Linux)
# 缺 时间, the level used by RHS is as follows:
# 0 - Stop (Do not set the initdefault to 0)
# 1 - Single user mode
# 2 - Multiple users, but no NFS
# 3 - Complete multi-user mode
# 4 - Nothing
# 5 - x11
# 6 - Restart (Don't set the initDefault to 6)
#
Detailed explanation of each run level:
0 is stopped, the machine is closed.
1 is a single user mode, just like the security mode under Win9x.
2 For multi-user mode, but there is no NFS support.
3 is a complete multi-user mode, which is a standard operating level.
4 Generally, it can be used to do something in some special cases. For example, when the battery's battery is exhausted, you can switch to this mode to do some settings.
5 is X11, go to the X Window system.
6 is restart, running the init 6 machine will restart.
Different runners have different uses, and should be set according to their own different situations. For example, if RO is lost
OT password, then
Let the machine start to enter the single user status. Enter the LILO prompt after startup:
INIT = / bin / sh rw
You can enter the running stage 1, and hang the root file system is read or written. He will skip all system certifications,
Let you use the Passwd program
To change the root password, then start to a new run level.
The adjustment of the Linux launch procedure is also a big problem for novices. In the later tutorial, we will introduce this
Aspects of knowledge.