Article Title: linux Startup sequence. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories. Let's look back at the linux Startup sequence: 1. BIOS self-check 2. Run the system kernel and check that starting from the hard disk, the MBR is a storage space of 446 bytes, which stores Bootloader, linux Bootloader is commonly used in LILO and Grub. The content stored in MBR is different!
Bootloader loading 3. the kernel is loaded into the first process of the operating system init 4. The init reads the information in the system boot configuration file/etc/inittab for initialization/etc/rc. d/rc. sysinit -- system initialization script/etc/rc. d/rcX. d/[KS] * -- configure the service/etc/rc according to the running level. d/rc. local -- execute local special configuration others -- special services of different running levels Linux starts to run the init program to start initialization of related programs. One concept related to startup is runtime level, the running level is the current running level of the operating system. At different running levels, you can define the Startup Program that belongs to the running level. The running level of the system can be specified in the/etc/inittab file, the running-level programs run through the source/etc/rc. d/init. d. Link to the destination/etc/rcX. d. Here, X is the default running level of the system. Therefore, the default startup script is placed in/etc/rc. d/init. d.
# The default running level is as follows: #0-stop (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.
There are two ways to enable the system to run a specified program at startup: Step 4 in the startup sequence.
One way is to configure the service according to the running level.
One way is to execute special local configurations.
For example, when a task is started, run the command cvslockd: Method 1: 1. Create a self-starting script/etc/rc. d/init. d/cvslockd with the following content :#! The attributes of the/bin/bash/usr/local/bin/cvslockd setting file are executable: # chmod + x/etc/rc. d/init. d/cvslockd 2. view the computer running level. In the file/etc/inittab, the system running level is 5. 3. in the/etc/rc5.d directory, make a soft connection to the executable file you want to execute, and start with the uppercase letter "S" when naming the file, the number size after S indicates the order of execution. The larger the number, the higher the execution order.
# Ln-s/etc/rc. d/init. d/cvslockd/etc/rc5.d/S100cvslockd # ln-s/etc/rc. d/init. d/cvslockd/etc/rc0.d/K20cvslockd Mode 2: in/etc/rc. d/rc. add exec/usr/local/bin/cvslockd to local. This method starts cvslockd at the end.
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