rhel7 红帽更改启动等级

查看配置文件

[root@rhel7 ~]# 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

#

查看上面橙色的内容,发现获取运行等级命令。

[root@rhel7 ~]# systemctl get-default
multi-user.target

设置运行等级5命令

[root@rhel7 ~]# systemctl set-default graphical.target

设置运行等级3命令

[root@rhel7 ~]# systemctl set-default multi-user.target

如果提示更改失败,或命令不可用。请手打命令。

如果只需要临时更改。

设置运行等级5命令

[root@rhel7 ~]# init 5

设置运行等级3命令

[root@rhel7 ~]# init 3

 

 

 

你可能感兴趣的:(Linux)