CentOS7设置默认启动方式-命令行或图形界面

查看当前状态

[[email protected] ~]# systemctl get-default
graphical.target 

查看/etc/inittab的说明

 [[email protected] ~]# 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
#
[[email protected] ~]# 

设置默认启动方式

[[email protected] ~]# systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
[[email protected] ~]# 

重启系统后再次查看默认启动方式

[[email protected] ~]# systemctl get-default
multi-user.target 

0 Comments

发表评论

电子邮件地址不会被公开。 必填项已用*标注