Sunday, October 3, 2010

Turn off some commonly unneeded services

Keeping a server appliance healthy can often mean nothing more than getting rid of services that absorb resources. These services are things that are installed by default, but are not used. Here is a quick BASH script to turn off some commonly unneeded services. While I titled this post Centos 5.x, you should be able to use it with most any distro that makes use of /etc/init.d/SCRIPT scripts.



#!/bin/bash
 
services="acpid anacron apmd autofs bluetooth cups firstboot gpm haldaemon messagebus mdmonitor hidd ip6tables kudzu lvm2-monitor netfs nfslock pcscd portmap rpcgssd rpcidmad sendmail smartd yum-updatesd"
for service in $services; do
service  $service stop
chkconfig --del $service
done

No comments:

Post a Comment