各个级别的作用
0(poweroff.target):关机
1(rescue.target):单用户模式
2、3、4(mulit-user.target):多用的文本界面
5(graphical.target):多用的图形界面
6(reboot.target):重启
systemctl get-default 获取系统的默认级别
runlevel 获取系统的默认级别
systemctl set-default reboot.target 永久调整级别,下次重启生效
init 6 临时调整级别
systemd
systemd配置详解链接
常用命令:
systemctl status 查看服务运行状态
systemctl cat 查看服务的配置文件所在位置
systemctl start 启动服务
systemctl restart 重启服务
systemctl stop 暂停服务
systemctl reload 重新加载配置文件
systemctl is-active 查看服务是否正在运行
单用户模式
重启虚拟机,
在选择系统界面,按下e,
在quit 后面输出 enforcing=0 /bin/bash ,
ctrl+x 进入单用户模式 ,
mount -o rw,remount / 重新挂载根目录,指定读写权限