chkconfig is a nice utility you’ll find in RedHat/Fedora Linux and its derivatives.
This utility enables you to tell the operating sytem what services should be executed and brought to life upon reboot of the server.
To understand chkconfig you have to keep in mind that Linux boots up into different run levels. A run level is a way of specifying what services should run when you boot up the server for different reasons. The main run levels I am concerned with are run levels 3 and 5. Level 3 is console mode, level 5 is full GUI or X Windows mode.
My servers boot into Level 3, so I configure what services will start up on level 3 by using the chkconfig command.
Example:
# chkconfig --level 3 foobar on
This example indicates that the foobar service should start up every time the server is rebooted into Level 3. My server is set to boot into Level 3 by default, so I know if the machine is rebooted the web server will come back on.
It is important for security to turn off as many services as you can get by with.
To get a listing of the services that are on and what ports are open on your server you can use the netstat command, and also use chkconfig like this:
# chkconfig --list | more
If you are looking for a specific service, and trying to determine if it comes on at a certain run level, you can try this:
# chkconfig --list | grep foobar
If you don’t care what run level a service starts up on, and you just want to make sure a service starts no matter what run level the machine starts on, you can do this:
# chkconfig foobar on