长期以来,多数Linux发行版一直在使用Unix System V引入的 init 系统。
init 由内核自身产生,任务是启动系统剩余部分,产生并监视所有其它进程,看其是否停止或僵死。
System V init 虽然过去一直运行的很好,但它已经有些迟暮了。
这也是 Ubuntu 为什么会使用Upstart来代替正在老化的 init 系统。
获取源代码地址: 从http://upstart.ubuntu.com/
linux启动过程如下图所示:
我们可以将整个过程划分为 3 个基本步骤,我将它们分别称之为 BIOS、内核引导 和 系统初始化
1. 通过init,添加新的守护进程
ubuntu 系统中 /etc/init/ 下会有很多 *.conf 文件. 如 acpid.conf.
xxha@xxha:/etc/init$ cat acpid.conf
# acpid - ACPI daemon
#
# The ACPI daemon provides a socket for other daemons to multiplex kernel
# ACPI events from, and a framework for reacting to those events.
description "ACPI daemon"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork