一、舊版本linux系統修改inittab文件,在新版本執行vi /etc/inittab 會有如下提示linux
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/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 view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target .net
二、正確作法:
[ryan@test ~]$ systemctl get-default
graphical.target
[ryan@test ~]$ sudo systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user
.target.You have new mail in /var/spool/mail/ryan
[ryan@test ~]$ systemctl get-default
multi-user.target
[ryan@test ~]$get