zoukankan      html  css  js  c++  java
  • CentOS7修改默认运行级别

     新装了一个虚拟机,图形界面启动太慢,想调整一下按照以前的经验改运行级别,输入:

    vi /etc/inittab

    然后发现跟之前不一样了,在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
    #
    复制代码
    仔细读一下上面的提示
    multi-user.target 类似与之前的runlevel 3
    graphical.target 类似与之前的runlevel 5

    按照上面的提示,查看当前的默认target输入命令:
    [root@localhost ~]# systemctl get-default
    graphical.target
    [root@localhost ~]# 
    当前为graphical.target

    修改为命令模式multi-user.target:
    [root@localhost ~]# systemctl set-default multi-user.target
    rm '/etc/systemd/system/default.target'
    ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'
    [root@localhost ~]# 

    查看一下当前,发现得到预期要求:

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

     

    最后重启发现,果然是命令模式~~

     
  • 相关阅读:
    HTML th nowrap 属性
    C 语言实例 – 判断闰年
    Java MySQL 连接
    Linux shapecfg命令
    C 简介
    Java 之 HashSet 集合
    Java 之 Set 接口
    Java 之 LinkedList 集合
    Java 之 List 接口
    JavaScript 之 事件(详解)
  • 原文地址:https://www.cnblogs.com/chriszsy/p/13216118.html
Copyright © 2011-2022 走看看