Init. d, rc. d What are the steps required for Linux startup? This article describes in detail the roles of different running levels in startup. Linux seems to be a monster for advanced users on the DOS/Win9x/NT platform. No config. sys, no...
Init. d, rc. d What are the steps required for Linux startup? This article describes in detail the roles of different running levels in startup. Linux seems to be a monster for advanced users on the DOS/Win9x/NT platform. No config. sys, no autoexec. bat, and machine configurations with personal characteristics do not know where to start. Www.2cto.com needs to note that many people think that Linux is a clone of Unix, but this statement is unfair to Linux. Linux is more open and powerful than Unix. We should call it GNU/Linux. When Linux is started, it runs a program called init and starts subsequent tasks, including multi-user environments and networks. So what is the runtime level? Simply put, the running level is the function level currently running in the operating system. This level ranges from 1 to 6 and has different functions. These levels are specified in the/etc/inittab file. This file is the main file found by the init program. The first service to run is the files stored in the/etc/rc. d Directory. In most Linux releases,/etc/rc. d/init. d is started. These scripts are used by ln commands to connect to the/etc/rc. d/rcn. d Directory. (Here n is the running level 0-6) for example/etc/rc. the S10network under d/rc2.d is connected to/etc/rc. d/init. d. Therefore, we can know that the files under rc2.d are related to Operation Level 2. "S" at the beginning of the file indicates that "start" indicates that the service is started, and "10" indicates the order in which the service is started. For example, in the same directory, you can also see the S80postfix file. The order of 80 is after 10, because if the network is not started, starting postfix does not work. Check/etc/rc. d/rc3.d again. you can see the file S60nfslock, but this file does not exist in the/etc/rc. d/rc2.d directory. NFS uses this file, which is generally used in multi-user environments, so it is stored in the rc3.d directory. In addition, you can see files starting with K in/etc/rc. d/rc2.d, for example,/etc/rc. d/rc2.d/K45named, and K indicates kill. The standard Linux operating level is 3 or 5. if it is 3, the system is in the multi-user state. If it is 5, the X Window System is running. If it is currently 3 or 5, and you reduce the running level to 2, init will execute the K45named script. Different running levels are defined as follows: (refer to/etc/inittab in Red Hat Linux) # The default running level. RHS uses the following levels: www.2cto.com #0-downtime (do not set initdefault to 0) #1-single-user mode #2-multiple users, but there is no NFS #3-full multi-user mode #4-not used #5-X11 #6-restart (do not set initdefault to 6) # detailed explanation of each running level: 0 indicates that the machine is shut down. 1 is the single-user mode, just like the security mode in Win9x. 2: Multi-user mode, but not supported by NFS. 3 is a complete multi-user mode, which is a standard operation level. 4. Generally, you can use it to do things in some special cases. For example, you can switch to this mode to make some settings when the battery of your laptop is exhausted. 5 is X11, and it enters the X Window System.
6. restart the init 6 server. Different running levels have different functions and should be set according to different situations. For example, if the root password is lost, you can set the machine startup status to a single user. Enter init =/bin/sh rw at the lilo prompt after startup to enable the machine to enter runtime level 1 and mount the root file system to read/write. He will skip all system authentication, so that you can use the passwd program to change the root password, and then start to a new running level.
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.