您的位置:首页 > 运维架构 > Linux

rhel6和rhel7日常使用差别

2017-12-21 14:35 246 查看
服务相关命令

systemctl管理服务的启动、重启、停止、重载、查看状态的命令:

Sysvinit命令(RHEL6)
Systemctl命令(RHEL7)
作用
service
name start
systemctl start
name.service
启动服务
service
name restart
systemctl restart
name.service
重启服务
service
name stop
systemctl stop
name.service
停止服务
service
name reload
systemctl reload
name.service
重新加载配置文件(不终止服务)
service
name status
systemctl status
name.service
查看服务状态
systemctl设置服务的开机启动、不启动、查看各级别下服务启动状态的命令:

Sysvinit命令(RHEL6)
Systemctl命令(RHEL7)
作用
chkconfig
name on
systemctl enable
name.service
开机自动启动
chkconfig
name off
systemctl disable
name.service
开机不自动启动
chkconfig
name
systemctl is-enabled
name.service
查看特定服务是否为开机自启动
chkconfig --list
systemctl list-unit-files --type=service
查看各个级别下服务的启动与禁用情况
 
单用户与多用户以及selinux开启关闭文件

rhel6
rhel7
说明
cat /etc/inittab
systemctl get-default
1为单3或5为多用户
vim /etc/inittab
systemctl set-default rescue.target(id:1)

 
systemctl set-default graphical.target(id:5)
 
systemctl set-default multi-user.target (id:3)
切换多用户与单用户
/etc/selinux/config
/etc/sysconfig/selinux
开启关闭selinux文件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux rhel 测试