#!/bin/bash

## Author: Colin Wong
## 由于想使用KVM虚拟化技术,想把父系统搞得干净一点,所以关闭一些无用的服务器
## 值得注意的是:该脚本并不适合所有人,操作前请慎重选择。
Service="blk-availability acpid atd auditd avahi-daemon avahi-dnsconfd bluetooth conman cpuspeed cups dnsmasq firstboot httpd ibmasm ip6tables kdump mcstrans microcode_ctl netconsole netfs netplugd nfs nfslock nscd ntpd oddjobd pand pcscd portmap psacct rdisc restorecond mdmonitor rpcgssd rpcidmapd rpcsvcgssd saslauthd sendmail vncserver wpa_supplicant xfs ypbind"

for i in $Service
do
### 关闭所选服务自启动
chkconfig $i off
### 停止所选的服务
service $i stop
done

#### 服务详解
#blk-availability	lmv2相关,启用lvm就开启
#acpid		电源的开关等检测管理,常用在Laptop上
#auditd		审核守护进程,selinux需要开启它
#bluetooth	蓝牙无线通讯	
#cups		通用unix打印服务
#cpuspeed	调节cpu速度用来省电,常用在Laptop上
#dnsmasq		dns cache
#ip6tables	用到ipv6网络的就用,一般关闭
#restorecond	如果开启了selinux,就需开启
#rpcgssd		NFS相关服务,可选