首页 > 系统服务 > 详细

Ubuntu关闭开机自启项

时间:2021-02-22 20:26:21      阅读:35      评论:0      收藏:0      [点我收藏+]

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关闭开机自启项

原文:https://www.cnblogs.com/xhzj/p/14432095.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!