CentOS7 systemctl的使用

mac2022-06-30  21

# 查看正在运行的服务

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

 

转载于:https://www.cnblogs.com/D-Chen/p/5621281.html

最新回复(0)