1.设置开机启动
systemctl enable xxx.service 如:systemctl enable nginx.service
2.设置禁止开机启动
systemctl disable xxx.service 如:systemctl disable nginx.service
3.查看服务状态信息
systemctl status xxx.service 如:systemctl status nginx.service
4.仅显示活动状态
systemctl is-active xxx.service 如:systemctl is-active nginx.servie
5.启动服务
systemctl start xxx.service
6.停止服务
systemctl stop xxx.service
7.查看所有已启动的服务
systemctl list-units --type=service
8.重启动服务
systemctl restart xxx.service
原文地址:https://www.cnblogs.com/itwlp/p/10582020.html
时间: 2024-11-05 11:26:32