更新时间:2020-07-07 来源:黑马程序员 浏览量:
问题:CentOS6与CentOS7运行模式有什么区别?
答:CentOS6与CentOS7的运行模式有所不同
[root@centos7 ~]# cat /etc/inittab
# inittab is no longer used when using
systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON
YOUR
SYSTEM.
#
# Ctrl-Alt-Delete is handled
by
/usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses
'targets' instead of runlevels. By
default, there are two main
targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous
to runlevel 5
#
# To view current default target, run:
# systemctl
get-default
#
# To set a default target, run:
# systemctl set-default
TARGET.target
#
CentOS6 CentOS7
0 shutdown.target(关机模式)
1 rescure.target(单用户/救援模式)
2
multi-user,without NFS(字符模式但是缺少NFS服务)
3 multi-user.target(字符模式)
4
unused(未使用的模式,系统保留)
5 graphical.target(图形模式)
6 reboot.target(重启模式)
但是在CentOS7版本中,我们需要使用systemctl的方式进行切换:
获取Linux默认级别
# systemctl get-default
设置Linux默认级别(字符模式)
# systemctl
set-default multi-user.target
下面是黑马程序员公开的几套视频教程,可以跟着学习学习,如果想深入学习,转到运维行业,建议报班学习黑马程序员linux云计算+运维开发培训课程。