更新時間:2020-07-07 來源:黑馬程序員 瀏覽量:
問題:CentOS6與CentOS7運行模式有什么區(qū)別?
答:CentOS6與CentOS7的運行模式有所不同
[root@centos7 ~]# cat /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
/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
#
CentOS6 CentOS7
0 shutdown.target(關(guān)機模式)
1 rescure.target(單用戶/救援模式)
2
multi-user,without NFS(字符模式但是缺少NFS服務(wù))
3 multi-user.target(字符模式)
4
unused(未使用的模式,系統(tǒng)保留)
5 graphical.target(圖形模式)
6 reboot.target(重啟模式)
但是在CentOS7版本中,我們需要使用systemctl的方式進行切換:
獲取Linux默認(rèn)級別
# systemctl get-default
設(shè)置Linux默認(rèn)級別(字符模式)
# systemctl
set-default multi-user.target
下面是黑馬程序員公開的幾套視頻教程,可以跟著學(xué)習(xí)學(xué)習(xí),如果想深入學(xué)習(xí),轉(zhuǎn)到運維行業(yè),建議報班學(xué)習(xí)黑馬程序員linux云計算+運維開發(fā)培訓(xùn)課程。