This command-line tool and be use in five different modes:
- Adding new services
- Removing services
- Reporting on current services
- Turning services on and off
- Reporting on service status
One of the more useful ways to use this command is to report on a specific service.
Note: these commands are best run as either root or using sudo.
#chkconfig –list httpd
This command will list init run levels that this service is set to run in.
This is the output from that command (example only).
[root@server ~]# chkconfig –list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
To delete a service from all init run levels, use the following:
To add a new service:
For a more detailed approach when adding services, you can specify which run levels the new service will be configure to. For example:
#chkconfig –level 35
This will result in your specified service only running in run levels 3 and 5.
#chkconfig –level 01246
This will result in your specified service not running in run levels 0, 1, 2, 4 & 6. Leaving the service to run in 3 and 5.
More information can be found at the following links.