=============================================== The chkconfig command and SysV start-up scripts =============================================== -IAN! idallen@idallen.ca In this file: # chkconfig --list # chkconfig nntp reset Linux SysV-style service start-up scripts are kept in directory /etc/init.d/ (or in /etc/rc.d/init.d/). Symbolic links to these scripts are placed in directory /etc/rc?.d/ (or in /etc/rc.d/rc?.d/). The symbolic links starting with "S" and a number start a service; the symbolic links starting with "K" and a number stop ("kill") a service. A service is started in a run level by calling its SysV start-up script with a single argument of "start". A service is stopped in a run level by calling its SysV start-up script with a single argument of "stop". Most run-level changes happen at boot time and shut down, though you can use the "telinit" command to change run levels any time. While is is always possible to create and remove the symbolic links in the rc?.d directories by hand (using "ln -s" and "rm"), the chkconfig command is a handy tool for listing and manipulating these symbolic links in their run level directories. The chkconfig output consists of a list of the services found in the init.d directory, followed by a separate list of the services controlled by the xinetd "super-server" (under the title line "xinetd based services"). Below are a list of the common uses of chkconfig. Find out all the services that are installed (but that may or may not be configured to start in some run level): # chkconfig --list httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off alsa 0:off 1:off 2:off 3:on 4:off 5:on 6:off ... hotwayd: on proftpd-xinetd: off saned: on Find out which services are enabled to start in at least one run level: # chkconfig --list | grep :on | sort alsa 0:off 1:off 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off ... xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off List a particular service: # chkconfig --list network network 0:off 1:off 2:on 3:on 4:on 5:on 6:off -------------------------------- Resetting symlinks for a service -------------------------------- Many/most of the SysV start-up scripts contain a "chkconfig" comment line in the comments at the start of the script. The comment line might look something like this: # chkconfig: 2345 55 10 The above shell comment line is readable by "chkconfig" if you give chkconfig the "reset" option for that service. With "reset", chkconfig will automatically create start/stop symlinks in run levels 2,3,4,5 at priority 55 and 10 if you use this chkconfig command line as root. For example: bash# chkconfig ntpd reset Now "chkconfig --list" will show ntpd enabled in run levels 2,3,4,5. It will start at priority 55 and stop at priority 10. Note: You can always add the appropriate start/stop ntpd symlinks manually in the rc?.d directories if the above procedure isn't possible because the chkconfig command is missing. Don't depend on chkconfig!