RHEL-CentOS-MinimalServicesSetup

download RHEL-CentOS-MinimalServicesSetup

If you can't read please download the document

description

Original was found at http://anchorite.org/blog/2006/11/13/minimal-services-on-centos-44-mini-howto/Posted by Andrew MitryAuthored by Anton Thaker

Transcript of RHEL-CentOS-MinimalServicesSetup

When I started running Linux servers on VMware Server resource management became much more important. The limiting factor on the boxes I am running is RAM. The less RAM I could get a server to use, the more servers I could run. I put in a call to an old buddy of mine, Anton Thaker. Anton is a RedHat Certified Engineer (RHCE) and knows Linux better than anyone else I know. Anton wrote a mini-howto on freeing up resources by disabling unneeded services. Here it is: Heres a mini-howto to free up resources on a server system by disabling unneeded services. This is for a Minimal install of CentOS 4.4. First, a note on Minimal installations. Ive gotten into a habit of doing minimal installs and installing additional software as needed after installation. Using yum to install needed RPMs and their dependencies is very easy. The minimal installation reduces the number of packages requiring updates, makes it easier to keep a server clean in the long run and eliminates any kind of graphical environment. It also requires only the first installation CD, where any other type of installation will usually ask for 3 or all 4 CDs. The proper RedHat way to disable a service from being started at bootup is to use the chkconfig utility. After installation the machine reboots. When you login disable as many service as possible with the following commands: chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig acpid off atd off autofs off cpuspeed off cups off gpm off haldaemon off isdn off mdmonitor off messagebus off netfs off nfslock off openibd off pcmcia off portmap off rawdevices off rpcgssd off rpcidmapd off smartd off xinetd off

You can turn off microcode_ctl if this is an AMD machine, and irqbalance if there is only one CPU. If you plan on using plug and play devices you should leave haldaemon and messagebus running. If you did not do a minimal install youll have more services enabled. Run the following to see what else is enabled: chkconfig list |grep 3:on |awk {print $1} |sort

On my machine the above command lists: anacron crond iptables kudzu network sendmail sshd syslog I left anacron and kudzu enabled, because its something that will run at startup and will not stay loaded when finished. Sendmail is there for email notifications, and can probably be taken out. Everything else in the list is pretty much the minimum. If you are not sure what something does, you can look in the particular services startup script to see the comments at the beginning. The scripts are in the /etc/init.d directory. Also instead of running 6 virtual terminals, I have only two. To disable them, edit the /etc/inittab file and comment out the ones that you dont want running like this: # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 #3:2345:respawn:/sbin/mingetty tty3 #4:2345:respawn:/sbin/mingetty tty4 #5:2345:respawn:/sbin/mingetty tty5 #6:2345:respawn:/sbin/mingetty tty6 Since this is a new install, make sure to run yum update and then reboot the machine to apply the kernel update and stop the services that we just disabled. If you dont want to reboot, you can run /etc/rc to stop the services not enabled in the current run level. Its a good idea to reboot to make sure that the system comes up properly. The minimal installation takes about 721 MB of disk space. On a system with 64 MB of RAM this setup utilizes about 17 MB of RAM. Thanks for reading. Anton Thaker. RHCE