200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > CentOS7服务管理(重启 停止 自动启动命令)

CentOS7服务管理(重启 停止 自动启动命令)

时间:2022-09-19 09:33:47

相关推荐

CentOS7服务管理(重启 停止 自动启动命令)

我们对service和chkconfig两个命令都不陌生,systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。

systemctl is-enabled iptables.servicesystemctl is-enabled servicename.service #查询服务是否开机启动systemctl enable *.service #开机运行服务systemctl disable *.service #取消开机运行systemctl start *.service #启动服务systemctl stop *.service #停止服务systemctl restart *.service #重启服务systemctl reload *.service #重新加载服务配置文件systemctl status *.service #查询服务运行状态systemctl --failed #显示启动失败的服务

举例:ssh服务

查看状态:

systemctl status sshd.service

启动服务:

systemctl start sshd.service

重启服务: systemctl restart sshd.service开机自启: systemctl enable sshd.service

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。