Chkconfig settings

From Brian Nelson Ramblings
Jump to: navigation, search

The chkconfig command can also be used to activate and deactivate services. The chkconfig --list command displays a list of system services and whether they are started (on) or stopped (off) in runlevels 0-6. At the end of the list is a section for the services managed by xinetd.

If you use chkconfig --list to query a service in /etc/rc.d, that service's settings for each runlevel are displayed. For example, the command chkconfig --list httpd returns the following output:

chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:off   5:on    6:off

chkconfig can also be used to configure a service to be started (or not) in a specific runlevel.

For example, to turn nscd off in runlevels 3, 4, and 5, use the following command:

chkconfig --level 345 nscd off

For example, to turn httpd on for runlevels 2, 3, 4, and 5 use the following command:

chkconfig --level 2345 httpd on