由命令行级别切换到窗口级别的命令未变:init 5或startxide
由窗口级别切换到命令行级别的命令未变:init 3命令行
新版本的运行级别都定义在 /lib/systemd/system下:get
[root@localhost ~]# ls -ltr /lib/systemd/system/runlevel*.target
lrwxrwxrwx. 1 root root 16 9月 10 20:58 /lib/systemd/system/default.target -> graphical.target
lrwxrwxrwx. 1 root root 13 9月 10 20:58 /lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx. 1 root root 15 9月 10 20:58 /lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx. 1 root root 17 9月 10 20:58 /lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 9月 10 20:58 /lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 9月 10 20:58 /lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx. 1 root root 16 9月 10 20:58 /lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx. 1 root root 13 9月 10 20:58 /lib/systemd/system/runlevel6.target -> reboot.target
能够针对不一样须要设置不一样的运行级别:
如设置命令行级别(init 3)方法:
[root@localhost ~]# ln -svf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target
或
[root@localhost ~]# ln -svf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
或
[root@localhost ~]#systemctl set-default multi-user.target
设置窗口级别(init 5)方法:
[root@localhost ~]# ln -svf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
或
[root@localhost ~]# ln -svf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
或
[root@localhost ~]#systemctl set-default graphical.target
it