歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

CentOS 7系統配置上的變化解析

安裝CentOS 7後,一開始有點兒無力吐槽的感覺,變化這麼大?

一、Runlevel
首先一條,原來一直用的CentOS-6.5-x86_64-minimal.iso光盤鏡像(400M左右無圖形系統小巧便捷),而7目前最小的鏡像是CentOS-7.0-1406-x86_64-livecd.iso(700M左右),默認安裝後是啟動圖形界面,按原來的習慣要改成啟動命令行,結果發現:

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

好吧,systemd一統天下了(它管的東西很多很多,學Centos7首先要搞定systemd)。

[root@localhost ~]# ls -Xl /etc/systemd/system/*.target
lrwxrwxrwx. 1 root root 36 7月 8 23:12 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target

我們來看看從前的runlevel都變成什麼樣了?

[root@localhost ~]# ls -Xl /lib/systemd/system
[root@localhost ~]# ls -Xl /lib/systemd/system/runlevel*.target
lrwxrwxrwx. 1 root root 15 7月 5 00:45 /lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx. 1 root root 13 7月 5 00:45 /lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx. 1 root root 17 7月 5 00:45 /lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 7月 5 00:45 /lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 7月 5 00:45 /lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx. 1 root root 16 7月 5 00:45 /lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx. 1 root root 13 7月 5 00:45 /lib/systemd/system/runlevel6.target -> reboot.target

修改默認啟動runlevel為 multi-user (貌似runlevel2 3 4 沒區別了)

[root@localhost ~]# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
[root@localhost ~]# ll -X /etc/systemd/system/*.target
lrwxrwxrwx. 1 root root 37 7月 10 09:42 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target

試試init 6 還好用不。

[root@localhost ~]# init 6
Connection to 192.168.150.180 closed by remote host.
Connection to 192.168.150.180 closed.

成,好用。:)

因為我從桌面版Linux 連接Centos7系統提示變成了中文,所以需要把Centos7 的root用戶語言改一下,回到原汁原味。

[root@localhost ~]# cp .bashrc .bashrc-back
[root@localhost ~]# echo 'export LANG="en_Us.UTF-8"' >> /root/.bashrc

在CentOS 7上利用systemctl添加自定義系統服務 http://www.linuxidc.com/linux/2014-07/104487.htm

CentOS 7.0下編譯安裝LNMP http://www.linuxidc.com/Linux/2014-07/104247.htm

CentOS 7.0體驗與之前版本的不同 http://www.linuxidc.com/Linux/2014-07/104196.htm

CentOS 7 正式版發布下載 http://www.linuxidc.com/Linux/2014-07/104146.htm

U盤安裝64位CentOS 6.5方法 http://www.linuxidc.com/Linux/2014-04/100035.htm

Win7安裝64位CentOS 6.4雙系統詳細圖文教程 http://www.linuxidc.com/Linux/2014-04/100032.htm

CentOS與Windows雙系統安裝注意事項記錄 http://www.linuxidc.com/Linux/2014-05/101571.htm

更多詳情見請繼續閱讀下一頁的精彩內容: http://www.linuxidc.com/Linux/2014-09/107375p2.htm

Copyright © Linux教程網 All Rights Reserved