CentOS7 systemctl的使用

# 查看正在运行的服务

systemctl

 

# 查看某个服务的状态

systemctl status httpd.service

 

# 启动服务

systemctl start  foo.service

如:systemctl start httpd.service 

 

# 停止服务

systemctl stop foo.service

如:systemctl stop httpd.service

 

# 重启服务

systemctl restart foo.service

如:systemctl restart httpd.service

 

# 重新加载配置文件

systemctl reload  foo.service

如:systemctl reload httpd.service

 

# 开机时启动一个服务

systemctl enable foo.service

如:systemctl enable httpd.service

 

# 开机时关闭一个服务

systemctl disable foo.service

如:systemctl disable httpd.service

 

# 查看服务是否开机启动

systemctl is-enabled foo.service

如:systemctl is-enabled httpd.service

 

posted @ 2016-06-27 19:05  D蓝叶  阅读(252)  评论(0编辑  收藏  举报