温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7系统运行级别简介

发布时间:2020-08-15 02:24:38 来源:ITPUB博客 阅读:214 作者:sqysl 栏目:建站服务器

centos7系统运行级别简介我们知道,centos6及之前的版本中,系统运行级别通过/etc/inittab文件进行设置和控制,但在centos7中,对这个文件的设置将不会对系统运行级别产生影响,这也是centos7中变化比较大的一部分特性。
下面,我们就来介绍下系统运行级别方面的内容。

1. 运行级别对应关系

    init level           systemctl target
    0                      shutdown.target
    1                      emergency.target
    2                      rescure.target
    3                      multi-user.target
    4                      无
    5                      graphical.target
    6                      无

2. 运行级别设置

1)语法:systemctl [command] [unit.target]
2)命令及参数:

  • command部分

get-default :获取当前的target;

set-default :将默认运行级别设置为指定的target;

isolate :切换至指定的运行级别。

  • unit.target部分:为上面1节部分中给出的运行级别

3. 常用运行级别相关命令
1)systemctl

systemctl get-default:获取当前的运行级别;

systemctl set-default multi-user.target:将默认运行级别设置为mulit-user;

systemctl isolate multi-user.target:不重启系统的情况下,将运行级别切换至mulit-user;

systemctl isolate graphical.target:不重启系统的情况下,将运行级别切换至图形模式。
2) 其他

runlvel:返回结果中,第一个数为之前运行级别,后一个数为当前运行级别;

init 5:将当前运行级别切换至5(图形模式)。
   

.

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI