centos7系列和之前版本的centos系统的区别

  • centos7使用最新的systemd技术优化系统的速率

区别一:网卡名称的区别

  修改方法:安装菜单出现时按TAB输入net.ifnames=0 biosdevname=0

已经安装好系统的参考方法,请参考http://oldboy.blog.51cto.com/2561410/1722101

区别二:setup命令的改变


centos7中setup命令由最新的umtui代替

区别三:主机名等相关配置文件

1.在centos7中主机名的配置文件被更改为/etc/hostname

永久修改主机名的方法

 

2.字符集的配置文件被修改为/etc/locale.conf

修改字符集的方法


区别四:/etc/rc.local要想使用必须加上可执行权限

区别五:运行级别的设置

之前的启动级别文件/etc/inittab已经不能用了

[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
#

 

查看运行级别的命令已经更改为:

[root@centos7 ~]# systemctl get-default 
multi-user.target

 修改运行级别的命令也已经修改

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

 之前的0-6运行级别已经修改为新的表示形式(运行级别2,3,4已经统一为multi-user.target)

[root@centos7 ~]# ll /usr/lib/systemd/system/runlevel*.target
lrwxrwxrwx. 1 root root 15 11月 14 16:01 /usr/lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx. 1 root root 13 11月 14 16:01 /usr/lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx. 1 root root 17 11月 14 16:01 /usr/lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 11月 14 16:01 /usr/lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 11月 14 16:01 /usr/lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx. 1 root root 16 11月 14 16:01 /usr/lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx. 1 root root 13 11月 14 16:01 /usr/lib/systemd/system/runlevel6.target -> reboot.target

区别五:chkconfig说管理的/etc/init.d/下的脚本只保留了两个其他的命令脚本都已经更换了编码方式并且更换了路径

以sshd的编码方式来举例子

  • centos6:
[root@lb01 ~]# file /etc/init.d/sshd 
/etc/init.d/sshd: Bourne-Again shell script text executable
  • centos7:
[root@centos7 ~]# file /usr/sbin/sshd
/usr/sbin/sshd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=dffebd4e9197e9684e7319708745c401d034e4dc, stripped

chkconfig所管理的服务也已全部更换为systemctl管理格式见下表

查看所管理服务的方法:

[root@centos7 ~]# systemctl list-unit-files 
UNIT FILE                                     STATE   
proc-sys-fs-binfmt_misc.automount             static  
dev-hugepages.mount                           static  
dev-mqueue.mount                              static  
proc-sys-fs-binfmt_misc.mount                 static  
sys-fs-fuse-connections.mount                 static  
sys-kernel-config.mount                       static  
sys-kernel-debug.mount                        static  
…………

tips.安装bash-completion可以补全systemctl的相关命令即使他们用空格隔开,可以通过yum安装

参考资料:

https://access.redhat.com/documentation/zh-CN/red_hat_enterprise_linux/  :红帽官方中文说明

posted on 2017-11-14 17:42  ExzaiTin  阅读(2327)  评论(0编辑  收藏  举报

导航