CentOS系统服务优化脚本

  1. #!/bin/bash
  2. #该脚本用于关闭服务器上非必须的系统服务项,并不适用于所有服务器,比如如果是文件服务器则NFS相关服务则不能关闭
  3. #定义所要停止的服务,可以根据实际服务器应用更改
  4. SERVICES="acpid atd auditd avahi-daemon bluetooth cups firstboot hidd ip6tables kudzu lvm2-monitor mcstrans mdmonitor microcode_ctl netfs nfslock pcscd portmap rpcgssd rpcidmapd xfs yum-updatesd"
  5. for service in $SERVICES
  6. do
  7. #关闭服务随系统启动
  8. chkconfig $service off
  9. #停止选择服务
  10. service $service stop
  11. done

下载脚本:https://www.centos.bz/wp-content/uploads/2011/10/optimize-service.sh

标签:Centos 发布于:2019-10-14 17:47:06