CentOS redhat Boot Process

Source: Internet
Author: User
Tags emit

Turn on the power of the PC, BIOS post, start with the boot device (usually the hard disk) set up in the BIOS, then boot the boot program installed on the device LILO or grub starts booting Linux,linux boot the kernel first, then executes the INIT program, The INIT program calls the Rc.sysinit and RC programs, Rc.sysinit and RC after the completion of the system initialization and operation of the service, after the return init;init started the Mingetty, opened the terminal for users to log on the system, the user login successfully entered the shell, so that the completion of the boot to the login The entire startup process of the recording.



After init processes, the system initiates control over the init process.

The/sbin/init process is the parent process of all processes, and when it is INIT, it reads the configuration file/etc/inittab first, doing the following:

1) Execute the System initialization script (/etc/rc.d/rc.sysinit), the basic configuration of the system, read and write to mount the root file system and other file systems, to the basic calculation of the system is running, the subsequent need to run the level of determination and the start of the corresponding services;

2) Determine the level of operation to enter after startup ;

3) Execute/ETC/RC.D/RC, which defines the order in which the service is started first after the K, and the specific service status for each runlevel is placed in the/ETC/RC.D/RCN.D (n=0~6) directory, all files are linked to/etc/ The corresponding file under INIT.D.

4)/etc/rc.d/rc$runlevel # $RUNLEVEL is the default operating mode

5)/etc/rc.d/rc.local

6) start the virtual terminal/sbin/mingetty

7) Run X on Run level 5

This is the final login interface that is presented to the user.

This completes the system boot process .

Description

The concept of system- initiated operational level and the customization method of the service;

When the INITRD can be detected and loaded normally, the final work is basically done by the operating system. When the system init process is up, the system initiates control over to the INIT process.

The/sbin/init process is the parent process of all processes, and when it is INIT, it reads the configuration file/etc/inittab first, doing the following:

1) Execute the System initialization script (/ETC/RC.D/RC.SYSINIT), basic configuration of the system, mount the root file system and other file system in read and write mode, and then need to determine the operation level and start the corresponding service. (from this point of view, if you want to define the init action of the system, you need to modify the/etc/rc.d/rc.sysinit script). Its main tasks are: Configuring SELinux, System clock, kernel parameters (/etc/ sysctl.conf), hostname, enable WAP partition, root file system check and two mounts (read and write), activate RAID and LVM devices, enable disk quota check and mount other file systems.

2) through the/etc/inittab file

[Email protected] etc]#Catinittab# Inittab is a used by upstart forThe default runlevel.## ADDING Other CONFIGURATION here would have NO EFFECT on YOUR system.## SYSTEM initialization i S started by/etc/init/rcs.conf## Individual runlevels is started by/etc/init/rc.conf## Ctrl-alt-delete is handled by/etc/init/control-alt-delete.conf## Terminal Gettys is handled by/etc/init/tty.conf and/etc/init/serial.conf,# with configurationinch/etc/sysconfig/init.## For information aboutWriteupstart event handlers, or how# upstart works, see Init (5), Init (8), and Initctl (8). # # Default RunLevel. The runlevels used are:#0-Halt (do not set Initdefault to this) #1-Single user mode#2-Multiuser, without NFS (the same as3,ifYou DoNot having networking) #3-Full multiuser mode#4-unused#5-x11#6-reboot (do not set Initdefault to this) #ID:5: Initdefault:
Cat- System V runlevel compatibility## This task runsthe old sysv-RC runlevel scripts.   filefile  rc.override and put your changes there.start on RunLevel [0123456  ]stop on RunLevel [!  /etc/rc.d/RC $RUNLEVEL [[email protected] init]#
[Email protected] ~]#Cat/etc/rc.d/RC #! /bin/bash## RC Thisfileis responsible forstarting/stopping# Services when the RunLevel changes.## Original Author: # Miquel van Smoore Nburg,<[email protected]NL.mugnet.org>#set-m# Check afileTo is a correct runlevel scriptcheck_runlevel () {# CheckifThefileexists at all. [ -X" $"] || Return1Is_ignored_file" $"&& return1return0}# NowFindWhat the previous runlevel are.argv1=" $"Set $ (/sbin/runlevel) RunLevel=$2previous=$1export RunLevel Previous./etc/init.d/Functionsexport consoletypedo_confirm="No"if[-f/var/run/confirm]; Thendo_confirm="Yes"fiUpstart=[ -X/SBIN/INITCTL] && upstart=yes# SeeifWe want to beinchUser Confirmation Modeif["$previous"="N"]; Then        if["$do _confirm"="Yes"]; Then                Echo$"Entering Interactive Startup"        Else                Echo$"Entering non-interactive Startup"        fifi# Get first argument. Set new runlevel to this argument. [ -N"$ARGV 1"] && runlevel="$ARGV 1"# is there a RC directory forThis new runlevel?[ -D/ETC/RC$RUNLEVEL.D] | | Exit0# Set Language, VC settings once to avoid doing it forevery init script# through functionsif[-f/etc/sysconfig/i18n-a-Z"${nolocale:-}"] ; Then  . /etc/profile.d/lang.SH 2>/dev/NULLExport langsh_sourced=1fi# First, run the KILL scripts. forIinch/etc/rc$runlevel.d/k*; Do# CheckifThe subsystem is already up. Subsys=${i#/etc/rc$runlevel.d/k??}        [ -f/var/lock/subsys/$subsys-o-f/var/lock/subsys/$subsys. init] | |Continue Check_runlevel"$i"||continue # Bring the subsystem down. [ -N"$UPSTART"] && initctl emit--quiet stopping job=$subsys $i Stop [-N"$UPSTART"] && initctl emit--quiet stopped job=$subsys Done# Now run the START scripts. forIinch/etc/rc$runlevel.d/s*; Do# CheckifThe subsystem is already up. Subsys=${i#/etc/rc$runlevel.d/s??}        [ -f/var/lock/subsys/$subsys] &&Continue [-f/var/lock/subsys/$subsys. Init] &&Continue Check_runlevel"$i"||Continue # If We're in confirmation mode, get user confirmation        if["$do _confirm"="Yes"]; ThenConfirm $subsys RC=$?if["$RC"="1"]; ThenContinueelif["$RC"="2"]; Thendo_confirm="No"                fi        fiUpdate_boot_stage"$subsys"# Bring the subsystem up. [ -N"$UPSTART"] && initctl emit--quiet starting job=$subsysif["$subsys"="Halt"-O"$subsys"="reboot"]; ThenExport Lc_all=C exec $i startfi$i Start [-N"$UPSTART"] && Initctl emit--quiet started job=$subsys Done[ "$do _confirm"="Yes"] &&RM-f/var/run/Confirmexit0[[Email protected]~]#
[Email protected] rc5.d]#pwd/etc/Rc5.d[[email protected] rc5.d]#lsK01SMARTD K61nfs-RDMA k89netconsole s10network s24nfslock s55sshdk02oddjobd K69RPCSVCGSSD K89rdi SC s11auditd S24RPCGSSD S70spice-Vdagentdk05wdaemon k73winbind K92pppoe-server S11portreserve s25blk-availability S80postfixk10psacct k74ntpd k95firstboot s12rsyslog s25cups S 82ABRT-ccppk10saslauthd k75ntpdate k95rdma s13cpuspeed s25netfs s82abrtdk15htcachecle          An k75quota_nld k99rngd s13irqbalance s26acpid s90crondk15httpd k76ypbind S01sysstat s13rpcbind s26haldaemon s95atdk50dnsmasq k84wpa_supplicant s02lvm2-monitor S15mdmonitor s26udev-post s99certmongerk50kdump k87restorecond s08ip6tables s22messagebus s28autofs S99localk60nfs K88SSSD s08iptables s23networkmanager s50bluetooth[[email protected] rc5.d]#

CentOS redhat Boot process

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.