rhel 7 刚刚出来不久,很多人已经开始测试使用,说实话改动的地方还是挺多的。runlevel的修改已经和之前的版本不一样了,rhel 7 的/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 -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target #
提示说明的还是挺清楚的,如果想把运行级别改成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
修改运行级别已经不用修改inittab了,直接执行以上2条命令就可以
本文出自 “徐三金那些年混IT的事” 博客,请务必保留此出处http://xu3jin.blog.51cto.com/2261216/1542119
原文:http://xu3jin.blog.51cto.com/2261216/1542119