Ubuntu-管理开机自启动服务
1. 管理服务启停工具
systemctl -- 将应用程序抽象为一个service,然后对这个service进行创建、启停、状态查看、配合journalctl进行日志管理
| 子命令 | 效果 |
|---|---|
| start | 启动 |
| stop | 停止 |
| restart | 重启 |
| status | 服务的当前状态 |
| enable | 开机启动 |
| disable | 开机禁止启动 |
| list-unit | 查询正在运行的服务列表 |
| list-unit-files | 查询所有服务的开机自启动状态 |
| list-dependencies | 查询服务的依赖关系 |
2. 当前用户开机自启动
明明通过systemctl禁用掉某个service开机自启动,但是还是开机自启动
# 列出当前用户下开机自启动,若某个服务不需要开机自启动,删除即可
ls ~/.config/autostart/

浙公网安备 33010602011771号