centos7与6的差别

CentOS 7.x开始,CentOS开始使用systemd服务来代替daemon,原来管理系统启动和管理系统服务的相关命令全部由systemctl命令来代替。

1、原来的 service 命令与 systemctl 命令对比

daemon命令 systemctl命令 说明
service [服务] start systemctl start [unit type]  启动服务
service [服务] stop systemctl stop [unit type]  停止服务
service [服务] restart  systemctl restart [unit type]  重启服务
     

此外还是二个systemctl参数没有与service命令参数对应

  • status:参数来查看服务运行情况
  • reload:重新加载服务,加载更新后的配置文件(并不是所有服务都支持这个参数,比如network.service)

应用举例:

#启动网络服务
systemctl start network.service
 
#停止网络服务
systemctl stop network.service
 
#重启网络服务
systemctl restart network.service
 
#查看网络服务状态
systemctl status network.serivce


2、原来的chkconfig 命令与 systemctl 命令对比

2.1、设置开机启动/不启动

daemon命令 systemctl命令 说明
chkconfig [服务] on systemctl enable [unit type]  设置服务开机启动
chkconfig [服务] off  systemctl disable [unit type]   设备服务禁止开机启动

应用举例:

#停止cup电源管理服务
systemctl stop c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值