An abbreviated description of the Linux Boot up process
Linux (引导)启动过程简述
1、The LILO boot loader starts the kernel
LILO 引导加载器启动内核
2、The Linux kernel configured by lilo or rdev decompresses and must find and mount the root filesystem.
If LILO or the kernel were not configured properly there can be a problem here.
LILO或者rdev配置的Linux内核解压并且找到并安装根文件系统。如果LILO或者内核没有正确地配置,就会产生问题。
3、The kernel after loading the root filesystem, starts the "init" program which may be located in /sbin/init. Reads /etc/inittab for configuration information.
内核加载过根文件系统之后,将启动init程序,该程序在/sbin/init。init进程从/etc/inittab读取配置信息。
4、/etc/inittab - init reads this file for configuration information. This file determines the starting run level and contains a line like:
/etc/inittab-init读取该文件的配置信息。该文件决定了系统的运行级别,通常包含类似如下的一行:
si::sysinit:/etc/rc.d/rc.sysinit
(表示系统启动时候,执行/etc/rc.d/rc.sysinit)
5、/etc/rc.d/rc.sysinit - In this case this entry in "/etc/inittab" causes the script file "/etc/rc.d/rc.sysinit" to be run.To add terminals or dial in modem lines on a system, add more lines in the /etc/inittab file, one for each terminal or dial in line similar to the following:
/etc/rc.d/rc.sysinit -“/etc/inittab”中的这一条将会运行脚本文件"/etc/rc.d/rc.sysinit"。为了给系统增加终端或者通过调制解调器进行拨号
在/etc/inittab 文件中增加更多的行,为每一个终端按照以下方式添加:
7:2345:respawn:/sbin/mingetty tty7
6、One of /etc/rc.d/rc or /etc/rc or /etc/init.d/rc is started from inittab which does initialization commands for boot at the set runlevel.
This is done by running startup and shutdown scripts for various services to be run at the given run level.
/etc/rc.d/rc ,/etc/rc 或 /etc/init.d/rc 中的某一个脚本将被inittab启动,该脚本做一些初始化的命令,使系统运行在设定的级别上。
这些是通过在指定的运行级别上,为不同的服务运行启动或者终止脚本而实现的。
7、/etc/rc.local is started from one of the startup scripts in the rc script file. This is where you should add custom features for your system.
/etc/rc.local 是在脚本文件rc中中运行的。为了设定特定的操作系统,你应该在这里添加适当的命令。
8、getty - Init starts a separate getty (or mingetty) for each terminal for which logins are to be allowed. Getty is restarted by init after each user has logged out so new users can log in. Network logins are not done by getty but by a different deamon per way of logging in (telnet or rlogin handled by the inetd internet super daemon).
Init为每一个终端启动单独的getty(或者mingetty),以允许用户进行登录。每个用户退出登录以使得新的用户登录,此时Getty被init重启。网络登录不是通过getty实现的。而是通过一个不同的守护进程实现的(tenet或者rlogin是通过端口监视守护进程处理的)
9、Getty outputs the welcome message in /etc/issue, reads the username and runs the login program.If the user is telnetting, the message in /etc/issue.net is first output.
Getty输出/etc/issue中的欢迎信息,读取用户名并运行login程序。如果用户为telnet形式,则/etc/issue.net首先输出。
10、The login program reads the password and runs the shell if the username and password are correct.The shell is based on entries in the /etc/passwd file and will run at the user's privilege level rather than with root privileges.
login程序读取密码并在用户名及密码正确的情况下运行shell。shell的入口在/etc/passwd中指定,并运行在用户的特权级别而不是root权限。
11、The shell (such as bash) runs the /etc/profile script file. However in the case of a system with shadow passwords, environment strings can be set first in a file called /etc/login.defs. Also a users resources can be limited in a file called /etc/limits. The $HOME/.bash_profile script is then run, but if it is missing /etc/.profile is run.
shell(例如bash)运行/etc/profile脚本文件。然而在一个使用影子密码的系统中,环境字符串首先通过文件/etc/login.defs设置。
同样的一个用户的资源科通过/etc/limits进行限制。$接下来运行脚本HOME/.bash_profile,如果不存在该文件,则运行/etc/.profile。
Pertinent files:
相关文件:
/dev/console - A virtual console device usually called /dev/ttyn where "n" is a terminal number.
虚拟控制台设备,通常叫做/dev/ttyn,这里的n是一个终端号;
/etc/ioctl.save - Contains the consoles ioctl(2) states
包含控制台的ioctl状态;
/var/run/utmp - A file where information on current system users is stored. The commands "w" and "who" can be used to display information in this file.
当前系统用户存储在该文件中。命令"w" "who"可以用于显示该文件中的信息;
/var/log/wtmp - Has a record of all logins and logouts
记录了所有登录与注销的用户记录;
/dev/initctl - Init's control fifo buffer file. Init listens on this fifo file for messages.
Telinit uses this to communicate with init. The file initctl is not a script file.
Init的控制fifo缓冲文件。Init监听来自fifo的信息。Telinit使用该文件与init进行通信。该文件不是脚本文件。
/etc/passwd - Contains information about the user including the ID, name, home directory, and the path to the preferred shell program. If not using shadow passwords,this file may also contain user passwords.
包含用户的ID,用户名,工作目录,shell路径,如果没有使用影子密码,则该文件也会包含用户密码。
In /etc/rc.d/rc0.d are kill and start scripts for various services.The kill scripts start with the letter "K" and the startup scripts start with the letter "S".
文件/etc/rc.d/rc0.d中,是终止与启动不同服务的脚本。终止脚本对应的脚本名以“K”开头,而启动脚本以“S”开头。