Linux system boot details (iii)

Source: Internet
Author: User

The previous section has the system Initramfs has started to complete, the system control to the real Rootfs/sbin/init, the following is the time/sbin/init work.

4/sbin/init

Initramfs init script, through the Switch_root command, after switching to the real root FS, the first program executed is the root FS under the/sbin/init,

4.1 Switch_root

Swith_root newroot Init [arg]

eg

The INITRAMFS switch to the real rootfs command is Switch_root/sysroot/sbin/init

where Root fs is mounted in the/sysroot directory

4.2/sbin/init

/sbin/init: It is the first program executed by the system, that is, using PA auxf view, the PID 1 program is it, it can be understood as the parent process of all processes of the system.

From the Rpm-qf/sbin/init, see upstart [6] for a detailed description of the/sbin/init program in the system from Upstart,upstart.

The traditional operating system/sbin/init is managed by System V Init, and upstart was originally developed for Ubuntu systems and is now used by more and more Linux systems. For the differences between system Vinit and upstart, refer to document [7].

/sbin/init The main process:

1, the implementation of/etc/rc.sysinit.

2. Execute/ETC/RC,RC script According to the incoming RunLevel, select Run script under the corresponding directory.

3, the implementation of/etc/rc.local

4.3 rc.sysinit

Roughly complete the following types of tasks:

1, File system mount (via grub incoming parameters, and configuration file, mount/repair file system).

2, module loading (through Udev rules, loading modules, such as network cards, user-defined rules, etc.).

3, SELinux related (not understood).

The following two links also have a few notes:

Http://linux.chinaunix.net/techdoc/beginner/2009/01/21/1059280.shtm

Http://www.cnblogs.com/image-eye/archive/2011/10/21/2220344.html

4.4 RC*.D

All service script directories, scripts of different levels corresponding to different directories are executed, which are no longer described in detail.

# Default RunLevel. The runlevels used is:

# 0–halt (do not set Initdefault to this)

# 1–single User mode

# 2–multiuser, without NFS (the same as 3, if you don't have networking)

# 3–full Multiuser mode

# 4–unused

# 5–x11

# 6–reboot (do not set Initdefault to this)

    • Related articles recommended:
    • Linux system boot details (i)
    • Linux system boot details (II.)
    • This article from: Hobby Linux Technology Network
    • This article link: http://www.ahlinux.com/start/base/8978.html

Linux system boot details (iii)

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.