微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

centos 7的Service与systemctl

似乎centos7之后(我的是7.3)把service命令给干掉了,有文章 说统一使用systemctl命令了。

下面记录下systemctl的使用:

  • 列出所有可用单元
systemctl list-unit-files
  • 列出所有运行中单元
  • systemctl list-units

    检查某个单元是否启用

systemctl is-enabled MysqLd.service

查看某个服务(单元)的状态

systemctl status MysqLd.service
  • 启动、关闭、重启服务
# systemctl start httpd.service
# systemctl restart httpd.service
# systemctl stop httpd.service
# systemctl reload httpd.service

*激活/禁止自动启动

# systemctl enable httpd.service
# systemctl disable httpd.service
  • *杀死服务
  • #systemctl kill httpd

原文地址:https://www.jb51.cc/centos/376659.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。