Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. Today I will talk about the sequence of Linux startup scripts. I hope you will remember the sequence of Linux startup scripts. If you need to manually enable a lot of services after the server is restarted, the work and future maintenance are relatively cumbersome, We have summarized the knowledge and methods involved in the Linux Automatic startup script:
Basic knowledge points
The redhat Startup Mode and execution sequence are as follows:
Load the kernel
Run the init program
/Etc/rc. d/rc. sysinit # The first script executed by init
/Etc/rc. d/rc $ RUNLEVEL # $ RUNLEVEL is the default running mode.
/Etc/rc. d/rc. local # after the corresponding level of service is started, you can also write the commands to be executed to the file when executing the file)
/Sbin/mingetty # Wait for User Login
In Redhat,/etc/rc. d/rc. sysinit mainly performs the same initialization in each running mode, including:
Incoming keymap and system font
Start swapping
Set Host Name
Set the NIS domain name
Check fsck) and mount the File System
Enable quota to load the sound card module and set the system clock.
/Etc/rc. d/rc executes scripts in the corresponding directory according to the running mode specified by its parameters (the running level, which can be set in the inittab file. All parameters starting with Kxx are called with the stop parameter. All parameters starting with Sxx are called with the start parameter. The call sequence is from xx to xx. (Xx indicates the Starting sequence.) For example, assume that the default running mode is 3,/etc/rc. d/rc will call/etc/rc as described above. d/rc3.d.
It is worth mentioning that the operating modes 2, 3, and 5 in Redhat put/etc/rc. d/rc. local is the last in the initialization script, so you can add some commands that need to be executed before logging on to this file.
Init is waiting for/etc/rc. after the execution of d/rc is completed, the/etc/rc is displayed in the/etc/inittab. d/rc's action is wait). It will run/sbin/mingetty on each specified virtual terminal and wait for the user to log on. So far, the Linux Startup has ended.
Learn about the sequence of Linux startup scripts and learn about Linux.
- How to obtain the file size in Linux
- Easily install Flash Media Server in Linux
- Linux memory management: red/black tree
- Describes how to configure the Clock Synchronization Service NTPD in Linux.
- Teach you how to build Linux in Windows