centos开机运行级别更改

1.使用命令切换运行级别/目标

# systemctl isolate multi-user.target //切换到运行级别3,该命令对下次启动无影响,等价于telinit 3

# systemctl isolate runlevel3.target //切换到运行级别3,该命令对下次启动无影响,等价于telinit 3

# systemctl isolate graphical.target //切换到运行级别5,该命令对下次启动无影响,等价于telinit 5

# systemctl isolate runlevel5.target //切换到运行级别5,该命令对下次启动无影响,等价于telinit 5

2.修改默认运行级别/目标

可以执行下面命令,设置启动时默认进入文本模式或图形模式。

# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target //文字模式

# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target //图形模式

开机启动进的目标是default.target,默认链接到graphical.target(大致相当于原来的运行级别5)。可以通过内核参数更改默认运行级别(见第1章)。

也可以执行systemctl命令,设置启动时默认进入文本模式或图形模式。

# systemctl -f enable multi-user.target //文字模式

# systemctl -f enable graphical.target //图形模式

 

 

posted @ 2015-10-10 21:49  木一木  阅读(261)  评论(0编辑  收藏  举报