• 查看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

  • 相关阅读:
    leetcode算法题基础(五)双指针(一)27 题 移除元素
    kata-shim: Setctty set but Ctty not valid in child: unknown.
    kata-runtime mount
    UVa1636 Headshot
    HDU1150 Machine Schedule
    POJ 1273 Drainage Ditches
    SPOJ GSS1 Can you answer these queries I
    POJ 1840 Eqs
    POJ2001 Shortest Prefixes
    HDU 2795 Billboard
  • 原文地址:https://www.cnblogs.com/zhaojingyu/p/9008926.html
Copyright © 2020-2023  润新知