Manage Auto Start services on CentOS

Most server admins want their servers to run as lean and secure as possible. For that reason, we usually try to disable as many services that are unneeded at start-up as possible. Here I will briefly explain how you can manage auto start services on your CentOS box and disable/enable any that you may or may not want starting.

DISCLAIMER:
The usual stuff. Make sure you backup your system and have a complete understanding of what services you disable/enable and any potential impact this may have on your server(s).

SERVICE MANAGEMENT:

Run this command to list the services that are currently run at start-up.

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

I suggest that you output this list to a file to allow you to compare before and after, as well as have the ability to revert any changes in case they cause issues. this can be done as follows:

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

Now that you have an idea of what is run at start-up, you can disable things, such as cups (Common Unix Printing Service).

chkconfig cups off

after disabling the services that you do now want to start on boot, you can create a second output file containing the enabled services and compare the 2.

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

To compare before and after:

diff before after

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.