其他分享
首页 > 其他分享> > 开机启动流程

开机启动流程

作者:互联网

开机启动流程

CentOS6

1.内核引导

加电自检,检查bios的配置,检测硬件,开机

2.运行init

3.系统初始化

4.建立终端

5.用户登录

## 关机命令
init 0
halt
shutdown -h now
shutdown -h 20:20
shutdown -h +10
poweroff

## 重启命令
init 6
reboot
shutdown -r now
shutdonw -r 20:20
shutdown -r +10

CentOS7开机启动流程

1.BIOS(开机自检)
2.MBR ( Master Boot Record 主引导记录)
3.GRUB2 Bootloader(引导菜单)
4.Kernel(内核引导)
5.Systemd (不再使用init,改成了systemd)

6.Runlevel-Target (运行级别)

运行级别:

init 0.target -> poweroff.target		# 关机
init 1.target -> rescue.target			# 单用户模式
init 2.target -> multi-user.target		# 多用户模式(没有文件系统和网络)
init 3.target -> multi-user.target		# 多用户模式(命令行)
init 4.target -> multi-user.target		# 多用户模式(还是没有被使用)		
init 5.target -> graphical.target		# 图形化模式
init 6.target -> reboot.target			# 重启
# 获取当前默认的运行级别
[root@qls ~]# systemctl get-default
multi-user.target

# 修改运行级别
[root@qls ~]# systemctl set-default poweroff

## 使用两条命令修改默认运行级别
[root@qls ~]# rm -f /etc/systemd/system/default.target
[root@qls ~]# ln -s /usr/lib/systemd/system/poweroff.target /etc/systemd/system/default.target


## 相关目录
[root@qls ~]# ll /etc/systemd/system   (默认的运行级别)
[root@qls ~]# ll /usr/lib/systemd/system (运行级别和服务启动脚本)

详解

标签:systemd,target,多用户,启动,流程,qls,init,开机,root
来源: https://www.cnblogs.com/mdddm/p/12945186.html