目录

工欲善其事

实践出真知

活跃标签: linux java mysql 待分类 windows js win10 springboot pdf idea docker 电路 nginx esp32 macOS git vue Arduino maven ffmpeg

存档:

Ubuntu关闭开机自启项

很多时候服务器重启速度越来越慢,cpu占用率越来越高,很大原因是服务器里面有很多开机自启项,需要手动查询出来并禁用!

首先用以下命令显示出开启的和未开启的程序:

systemctl list-unit-files

使用grep过滤一下开启的

systemctl list-unit-files |grep enabled

先停止已经开启的服务:

sudo systemctl stop mongodb.service
sudo systemctl stop nginx.service
sudo systemctl stop redis-server.service
然后禁用开机启动:

sudo systemctl disable mongodb.service
sudo systemctl disable nginx.service
sudo systemctl disable redis-server.service

可以用shell脚本的for循环来批量操作


标题:Ubuntu关闭开机自启项
作者:llilei
地址:http://solo.llilei.work/articles/2025/07/08/1751942325154.html