systemctl

启动服务

1
systemctl start foo.service

重启服务

1
systemctl restart foo.service

停止服务

1
systemctl stop foo.service

重新加载配置文件(不终止服务)

1
systemctl reload foo.service

查看服务状态

1
systemctl status foo.service

开机自动启动

1
systemctl enable foo.service

开机不自动启动

1
systemctl disable foo.service

查看特定服务是否为开机自动启动

1
systemctl is-enabled foo.service

查看各个级别下服务的启动与禁用情况

1
systemctl list-unit-files --type=service

浙ICP备11005866号-8