Skip to content

Systemd 入门命令

描述指令
启动服务systemctl start httpd
停止服务systemctl stop httpd
重启服务systemctl restart httpd
重载服务systemctl reload httpd
使某服务自动启动systemctl enable httpd
使某服务不自动启动systemctl disable httpd
检查服务状态systemctl status httpd (服务详细信息) systemctl is-active httpd (仅显示是否 Active)
显示所有已启动的服务systemctl list-units --type=service
重载所有修改过的配置文件systemctl daemon-reload

例子

sh
systemctl start nfs-server.service    #启动nfs服务
systemctl enable nfs-server.service   #设置开机自启动
systemctl disable nfs-server.service  #停止开机自启动
systemctl status nfs-server.service   #查看服务当前状态
systemctl restart nfs-server.service  #重新启动某服务
systemctl list-units --type=service   #查看所有已启动的服务
systemctl start nfs-server.service    #启动nfs服务
systemctl enable nfs-server.service   #设置开机自启动
systemctl disable nfs-server.service  #停止开机自启动
systemctl status nfs-server.service   #查看服务当前状态
systemctl restart nfs-server.service  #重新启动某服务
systemctl list-units --type=service   #查看所有已启动的服务

如有转载或 CV 的请标注本站原文地址