#系统初始化#
BIOS选择启动引导程序
Boot Loader加载系统内核
内核启动系统
初始化进程 #init# 是Linux系统启动后第一个进程,负责系统初始化工作(挂载文件系统、交换分区、启动各项进程服务等)。在RHEL 7之前,初始化进程为#System V init#,在7版本及之后,采用systemd初始化进程服务代替,涉及许多服务管理命令变动。
系统运行等级/目标对比:
System V init运行级别 systemd目标名称
0 poweroff.target
1 rescue.target
2 multi-user.target
3 multi-user.target
4 multi-user.target
5 graphical.target
6 reboot.target
emergency emergency.target
用户可以通过修改# /etc/systemd/system/default.target #的链接对象来设置默认运行目标(eg:ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target)
服务管理命令对比:
System V init systemd
service foo start systemctl start 启动
service foo restart systemctl restart 重启
service foo stop systemctl stop 停止
service foo reload systemctl reload 重新加载配置文件
service foo status systemctl status 查看状态
chkconfig foo on systemctl enable 开机自动启动
chkconfig foo off systemctl disable 开机不自动启动
chkconfig foo systemctl is-enabled 查看指定服务是否为开机自动启动
chkconfig --list systemctl list-unit-files --type= 查看各个级别下服务的自启动情况