Ubuntu关闭开机自启项 您所在的位置:网站首页 如何禁止启动 Ubuntu关闭开机自启项

Ubuntu关闭开机自启项

2024-07-11 17:59| 来源: 网络整理| 查看: 265

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循环来批量操作

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有