Fedora16修改默认运行级别

时间:2021-02-12 06:52:45
以前Fedora版本中修改运行级别方法为:
以root身份登入,编辑/etc/inittab文件
-----------------------------
 vi /etc/inittab
-----------------------------
找到   id:5:initdefault:  这一行,将默认运行级别5(图形模式)改为3(文本模式),即 id:3:initdefault:
然后重启
-----------------------------
 reboot
-----------------------------
 
但Fedora15和16使用systemd创建符号链接指向默认运行级别。
使用以上方法查看/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 /etc /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 set a default target, run :
#
# ln -s /lib /systemd /system / <target name >.target /etc /systemd /system / default.target
#
 
修改方法为:
1.首先删除已经存在的符号链接
----------------------------------------------------------------------------------
 rm /etc/systemd/system/default.target
----------------------------------------------------------------------------------
2.默认级别转换为3(文本模式)
----------------------------------------------------------------------------------
 ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
----------------------------------------------------------------------------------
  或者默认级别转换为5(图形模式)
----------------------------------------------------------------------------------
 ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
----------------------------------------------------------------------------------
3.重启
----------------------------------------------------------------------------------
 reboot
----------------------------------------------------------------------------------
参考文章: