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)
Linux system boot details (iii)