CentOS7的运行级别

一 查看当前运行的级别
[root@localhost ~]# runlevel
N 5

二 运行级别概念
第三运行级:
multi-user.target
第五运行级:
graphical.target

前者是符号链接指向了后面的target
runlevel3.target -> multi-user.target
runlevel5.target -> graphical.target

三 运行级别的切换
切换到:运行级3
下面这方法可以
systemctl isolate multi-user.target
举例
[root@localhost ~]# systemctl isolate multi-user.target
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
[root@localhost ~]# runlevel
5 3

切换到:运行级5
下面方法可以
systemctl isolate graphical.target
[root@localhost ~]# systemctl isolate graphical.target
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
PolicyKit daemon reconnected to bus.
Attempting to re-register as an authentication agent.
We are now a registered authentication agent.
[root@localhost ~]# runlevel
3 5

四 修改开机默认运行级别
切换到运行级3
systemctl set-default multi-user.target
[root@localhost ~]# 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.

切换到运行级5
systemctl set-default graphical.target
[root@localhost ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值