chkconfig.pl - Verify runlevel information for system services
chkconfig -list [name] # Default chkconfig -check # Not in RH version chkconfig -add name chkconfig -del name chkconfig [-level levels] name <on|off|reset> chkconfig [-level levels] name
This is a near clone of chkconfig as found on Redhat systems. The -add and -del examples are aliases for setting a service 'on' and 'off'. The -reset flag removes all symlinks for the service. The -check flag will report broken or orphaned services.
chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories.
This implementation of chkconfig was inspired by the chkconfig command present in the IRIX operating system. Rather than maintaining configu- ration information outside of the /etc/rc[0-6].d hierarchy, however, this version directly manages the symlinks in /etc/rc[0-6].d. This leaves all of the configuration information regarding what services init starts in a single location.
chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service.
When chkconfig is run without any options, it displays usage information. If only a service name is given, it checks to see if the service is configured to be started in the current runlevel. If it is, chkconfig returns true; otherwise it returns false. The --level option may be used to have chkconfig query an alternative runlevel rather than the current one.
If one of 'on', 'off' is specified after the service name, chkconfig changes the startup information for the specified service. The on and off flags cause the service to be started or stopped, respectively, in the runlevels being changed.
By default, the on and off options affect only runlevels 2, 3, 4, and 5. The --level option may be used to specify which runlevels are affected.
Note that for every service, each runlevel has either a start script or a stop script. When switching runlevels, init will not re-start an already-started service, and will not re-stop a service that is not running.
If no fatal errors are detected, the program exits with a return code of 0. Any error will set a non-zero return code.
Written by Terry Gliedt <email@example.com> in 2005 and is made available under terms of the GNU General Public License.