首頁  >  文章  >  系統教程  >  深入解析CentOS 7.1的運作等級與開機模式

深入解析CentOS 7.1的運作等級與開機模式

王林
王林轉載
2024-01-05 08:36:48756瀏覽

在大多數的linux發行版本中,通常有8個 runlevel

Runlevel System State

0 Halt the system

1 Single user mode

2 Basic multi user mode

##3 Multi user mode

5 Multi user mode with GUI

#6 Reboot the system

S, s Single user mode

可以在檔案 /etc/inittab 中查看

[root@wode003 ~]# cat/etc/inittab 

-bash: cat/etc/inittab: 沒有那個檔案或目錄

[root@wode003 ~]# 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

// get-default

[root@wode003 ~]# systemctl get-default

graphical.target

// set-default

[root@wode003 ~]# systemctl set-default multi-user.target

rm '/etc/systemd/system/default.target'

ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'

[root@wode003 ~]# systemctl get-default

multi-user.target#### ###[root@wode003 ~]# ###

以上是深入解析CentOS 7.1的運作等級與開機模式的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:jb51.net。如有侵權,請聯絡admin@php.cn刪除

相關文章

看更多