Search Posts on Binpipe Blog

Disable unwanted services in CentOS

You can use the following shell script in centos to disable inwanted services which may consume RAM. Please make sure you check which services you need to disable according to your requirement. My list of services in the below script is just indicative.

#!/bin/bash -x

# Disable unwanted services in Linux


services="rpcbind portreserve qpidd kdump abrt-ccpp abrt-oops abrtd ktune matahari-broker matahari-host matahari-network matahari-rpc matahari-service matahari-sysconfig quota_nld rngd tuned ntpdate iscsi iscsid tcsd saslauthd rawdevices isdn dnsmasq capi avahi-dnsconfd avahi-daemon NetworkManager NetworkManagerDispatcher acpid anacron apmd atd auditd autofs bluetooth conman cups cpuspeed dhcdbd dund firstboot gpm haldaemon messagebus mdmonitor mdmpd netplugd restorecond hidd ibmasm ip6tables irda irqbalance kudzu lvm2-monitor mcstrans microcode_ctl multipathd netconsole netfs nfs nfslock nscd oddjobd pand pcscd portmap psacct rdisc readahead_early readahead_later rpcgssd rpcsvcgssd rpcidmapd sendmail smartd wpa_supplicant ypbind yum-updatesd"


for service in $services; do

  /sbin/chkconfig --del $service

done

No comments:

Post a Comment

Hi, Leave a comment here and one of the binary piper's will reply soon :)