up

Optimize and disable default CentOS services



If you've ever wanted to disable common centos services the following is a good copy+paste guide. Note that these are more geared towards a virtual machine but may apply to hardware as well.

Before running the commands, you can create a list to compare what's been enabled and disabled

 

Run the following to see what else is enabled:

chkconfig --list |grep "3:on" |awk '{print $1}' |sort

If you want to compare the list before and after, you can:

chkconfig --list |grep "3:on" |awk '{print $1}' |sort > before

and

chkconfig --list |grep "3:on" |awk '{print $1}' |sort > after

run the block of chkconfig commands, then run a

diff before after

In order to see the changes.

 

Services below are typically safe to turn off immediately.

chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig autofs off
chkconfig cpuspeed off
chkconfig cups off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig isdn off
chkconfig netfs off
chkconfig nfslock off
chkconfig openibd off
chkconfig pcmcia off
chkconfig portmap off
chkconfig rawdevices off
chkconfig readahead_early off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig smartd off
chkconfig xfs off
chkconfig avahi-daemon off
chkconfig firstboot off
chkconfig yum-updatesd off 
chkconfig sendmail off
chkconfig mcstrans off
chkconfig pcscd off
chkconfig bluetooth off
chkconfig hidd off

 

The next group of services is more useful to servers in some circumstances.

 

xinetd

may be needed for some servers

acpid

needed for power button to shut down server gently

microcode_ctl

not needed on AMD machines

irqbalance

not needed unless running SMP

multiple cores, multiple processors, hyperthreading

haldaemon and messagebus

support for plug and play devices

mdmonitor

not needed unless running software RAID

 

Evaluate their worth even more closely before disabling them.

 

chkconfig xinetd off
chkconfig acpid off
chkconfig microcode_ctl off
chkconfig irqbalance off
chkconfig haldaemon off
chkconfig messagebus off
chkconfig mdmonitor off