systemctl 查看当前已安装服务(取代 chkconfig)
| 命令 | 说明 |
|---|---|
systemctl | 列出所有的系统服务 |
systemctl list-units | 列出所有启动 unit |
systemctl list-unit-files | 列出所有启动文件 |
systemctl list-units --type=service --all | 列出所有 service 类型的 unit |
systemctl list-units --type=service --all grep cpu | 列出 CPU 电源管理机制的服务 |
systemctl list-units --type=target --all | 列出所有 target |
systemctl list-unit-files | 列出所有的系统服务 |
systemctl is-active [unit type] | 查看服务是否运行 |
systemctl is-enable [unit type] | 查看服务是否设置为开机启动 |
systemctl mask [unit type] | 注销指定服务 |
systemctl unmask [unit type] | 取消注销指定服务 |
删除系统服务
1 | systemctl stop [servicename] |
注意事项: 如果有必要,在执行 systemctl reset-failed 之前删除 /etc/init.d/[servicename]。想找到要删除的所有单位文件,可以使用 systemctl cat 命令。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 小五的个人杂货铺!
