Linux system startup process and service management



December 27, Ding You year Name: Kevin
#### 1. System startup process:
one – Power-on self-test BIOS (Basic Input Output Sys/Basic Input Output System) [a set of programs solidified on a ROM chip on the computer motherboard, providing the computer with the lowest level and direct Hardware Settings] >>
two – MBR Boot (Main Boot Record/Master Boot Record) [The first sector on the hard disk, size: 512 bytes/byte "1b=8bit" After the system finds the RBM of the hard disk specified by the BIOS, it will It is copied to physical memory (Boot Loader)] >>
three – Boot Loader (LILO/GRUB) menu [initialize hardware devices, create a map of memory space, and prepare everything for calling the kernel! ]>> GRUB function: a. Select the kernel system to be started; b. Interactive interface (e enter edit mode); c. Based on password protection, enable kernel mapping to pass parameters!
fore – load Kernel (kernel) [According to the path of the kernel set by GRUB, read the memory image and decompress the kernel, put the decompressed into the memory, call the start_kernel() function to start a series of initialization functions and initialize various Equipment] >>
five – init process initialization [the first program to run after the kernel is loaded is /sbin/init, this file reads /etc/inittab to initialize the run level, and sets the first user layer executed by the level system Script: /etc/rc.d/rc.sysinit program, which sets PATH, network configuration (/etc/sysconfig/network), starts SWAP partition, sets /proc a series of configurations, etc. – starts kernel modules
– performs different operations Level script [run the corresponding script in rc0.d-rc6.c according to the different run level, so as to complete the corresponding initialization work and start the corresponding service]
– execute /etc/rc.d/rc.
– Execute /bin/login to enter the login state]
#### 2. Init run level, configuration file and system service management:
– Run level –
0: shutdown 1: single-user mode single 2: multi-user mode without network 3 : Multi-user mode with network 4: User-defined 5: Graphical interface Multi-user mode 6: Restart
– configuration file –
/etc/inittab (set the default run level)
/etc/sysconfig/init (control the number of terminals opened, colors scheme)
/etc/init/rcS.conf (loads the rc.sysinit script to complete the initialization task)
/etc/init/rc.conf (compatible script, responsible for the call processing of each run level)
/etc/init/rcS-sulogin.con (Starting in single-user mode /sbin/sushell)
/etc/init/control-alt-delete.conf (controlling hotkey operations)
/etc/init/start-ttys.con (configuring the number of devices to open the tty terminal)
/etc /init/tty.conf (control the opening of the tty terminal)
- view the run level -
-runlevel -startx (open the graphical interface)
- switch the run level -
init 0-6
- system service control -
- common way: service [service name d][Control Type]
- Control type: start (start) stop (stop) restart (restart)
reload (reload) status (view service status)
- service management tool -
-ntsysv tool: centrally manage services
-chkconfig tool: view the running status of each service
- Set the startup status of system services
chkconfig [-level level list] service name on | off


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325939161&siteId=291194637