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

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native