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

    一、centos6是通过修改/etc/inittab来修改默认运行级别的:

    [root@localhost ~]# vim /etc/inittab

    二、在centos7下运行vim /etc/inittab结果如下:

    [root@centos7 ~]# 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  相当于 runlevel 3
    # graphical.target: analogous to runlevel 5   相当于 runlevel 5
    #
    # To view current default target, run:
    # systemctl get-default --------------------- 获取当前运行级别
    #
    # To set a default target, run:
    # systemctl set-default TARGET.target ------- 设置运行级别
    #

    可以看到,里面除了注释,什么也没有,并没有centos6中设置默认运行级别的方式。


    三、CentOS 7.x 查看默认运行级别的方式为

    方式1
    [root@centos7 ~]# runlevel
    5 3
    
    
    方式2
    [root@centos7 ~]# systemctl get-default
    multi-user.target

    四、CentOS 7.x 设置默认运行级别命令:
           [root@centos7 ~]# systemctl set-default TARGET.target

    [root@centos7 ~]# systemctl set-default multi-user.target --------> 设置为runlevel 3
    Removed symlink /etc/systemd/system/default.target.
    Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.

    五、CentOS 7.x 运行级别 TARGET.target 对应表

    init级别

    systemctl target
    0 shutdown.target
    1 emergency.target
    2 rescure.target
    3 multi-user.target
    4
    5 graphical.target
    6
  • 相关阅读:
    JSP----获取表单参数
    application 从web.xml中获取初始化参数
    使用定时器分解任务
    无阻塞加载外部js(动态脚本元素,XMLHttpRequest注入,LazyLoad)
    ReactJs 入门DEMO(转自别人)
    带你一分钟理解闭包--js面向对象编程(转载他人)
    使用SqlBulkCopy进行批量数据插入
    AngularJsDEMO
    ECharts
    C#发送邮件DEMO
  • 原文地址:https://www.cnblogs.com/martinzhang/p/11253369.html
Copyright © 2011-2022 走看看