Linux之systemctl—service和chkconfig的替代者

最近玩Linux发现了systemctl这个命令,不管是Ubuntu还是Centos还是其他的发行版都有这个命令,其实这个命令早就存在了,相当于将service和chkconfig命令整合到一起了,实际上systemctl不仅仅包含service和chkconfig的功能,还有其他的功能,本文仅讨论systemctl与service,chkconfig的关系

systemctl与service对比

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

例:

#启动Apache
systemctl start httpd.service
#停止Apache
systemctl stop httpd.service
#重启Apache
systemctl restart httpd.service
#查看Apache状态
systemctl status httpd.service

systemctl与chkconfig对比

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

例:

#设置Apache开机启动
systemctl enable httpd.service
#禁止Apache开机启动
systemctl disable httpd.service
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值