zoukankan      html  css  js  c++  java
  • 查看linux系统的运行级别

    查看当前系统的运行级别
    [root@apenglinux ~]# runlevel
    3 5
    查看系统的默认级别
    [root@apenglinux ~]# systemctl get-default
    graphical.target


    设置系统的默认运行级别为3
    [root@apenglinux ~]# systemctl set-default multi-user.target

    [root@apenglinux ~]# rm -f /etc/systemd/system/default.target
    [root@apenglinux ~]# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target


    设置系统的默认运行级别为5
    [root@apenglinux ~]# systemctl set-default graphical.target
    [root@apenglinux ~]# rm -f /etc/systemd/system/default.target
    [root@apenglinux ~]# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target


    从3级别切换到5级别
    init 5
    systemctl isolate graphical.target


    从5级别切换到3级别
    init 3
    systemctl isolate multi-user.target


    查看系统的运行级别
    [root@apenglinux ~]# ls -l /lib/systemd/system/runlevel*target
    lrwxrwxrwx. 1 root root 15 1月 18 17:03 /lib/systemd/system/runlevel0.target -> poweroff.target
    lrwxrwxrwx. 1 root root 13 1月 18 17:03 /lib/systemd/system/runlevel1.target -> rescue.target
    lrwxrwxrwx. 1 root root 17 1月 18 17:03 /lib/systemd/system/runlevel2.target -> multi-user.target
    lrwxrwxrwx. 1 root root 17 1月 18 17:03 /lib/systemd/system/runlevel3.target -> multi-user.target
    lrwxrwxrwx. 1 root root 17 1月 18 17:03 /lib/systemd/system/runlevel4.target -> multi-user.target
    lrwxrwxrwx. 1 root root 16 1月 18 17:03 /lib/systemd/system/runlevel5.target -> graphical.target
    lrwxrwxrwx. 1 root root 13 1月 18 17:03 /lib/systemd/system/runlevel6.target -> reboot.target

  • 相关阅读:
    hdu6393 Traffic Network in Numazu 树链剖分
    codeforces 1180E Serge and Dining Room 线段树
    codeforces 546E Soldier and Traveling 网络流
    E
    poj3207 Ikki's Story IV
    【2020牛客多校第二场】F Fake Maxpooling
    【2020牛客多校第一场】J Easy Integration
    【ICPC2015沈阳M】Meeting
    【 AtCoder Beginner Contest 169】C Multiplication 3
    【AtCoder Beginner Contest 169】B Multiplication 2
  • 原文地址:https://www.cnblogs.com/zhaojingyu/p/9008926.html
Copyright © 2011-2022 走看看