CentOS 7 切换启动模式
命令
vim /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
从上面可知 centos 仍然只有两种启动模式
multi-user.target: analogous to runlevel 3 #命令行模式
graphical.target: analogous to runlevel 5 #图形模式
通过
systemctl get-default
命令获取当前模式
[root@MiWiFi-R1CM-srv xinetd.d]# systemctl get-default
graphical.target
通过
systemctl set-default multi-user.target
命令,修改启动模式
[root@MiWiFi-R1CM-srv xinetd.d]# systemctl get-default
multi-user.target
reboot
检验下设置效果
网友评论