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] |
- 注意的一点(如果有必要)
1
2在systemctl reset-failed之前删除/etc/init.d/[servicename]
想找到要删除的所有单位文件,可以使用systemctl cat
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 小五的个人杂货铺!
