See http://phpcj.org/blog/%E4%B8%8D%E5%90%8Clinux%E7%B3%BB%E7%BB%9F%E6%B7%BB%E5%8A%A0%E5%BC%80%E6%9C%BA%E5%90% af%e5%8a%a8%e7%a8%8b%e5%ba%8f%e7%9a%84%e5%91%bd%e4%bb%a4/
commands for adding boot programs to different Linux systems
Author: Breeze Date: September 16, 2011 Comment (0) View comments
Gentoo
Rc-update Add nginx Default
Centos/fedora:
Chkconfig Nginx on
Ubuntu:
Update-rc.d-f Nginx Defaults
=======================================================================================================
Detailed explanations of each run level:
0 for downtime, the machine shuts down.
1 is a single-user mode, similar to the safe mode under Win9x.
2 is multi-user mode, but there is no NFS support.
3 is the full multi-user mode and is the standard run level.
4 generally not, in some special cases you can use it to do something.
For example, you can switch to this mode to do some setup when your laptop's battery is running out.
5 is X11, into the X Window system.
6 Restart, the init 6 machine will restart.
=======================================================================================================
- Download the BIOS hardware and self-test, and according to the device, obtain the first available device;
- Read and execute the boot Loader (that is, grub, Spfdisk, and so on) of the first installation MBR;
- Depending on the boot loader's setup, the Kernel will start to detect the hardware and load the driver Kernel;
- After the hard drives succeed, the Kernel will call the INIT program, and INIT will get run-level information;
- Init performs/etc/rc.d/rc.sysinit files to prepare software for the business environment (e.g., Internet, time zone, etc.);
- Init performs the run-level of each service (script mode);
- Init performs/etc/rc.d/rc.local files;
- Init performs the end machine simulation program Mingetty to activate the login program, and finally waits for the user to log in.