During bootup, the system will execute scripts and updates and queries runlevel information for system services.
Each service which should be manageable by chkconfig.
These tools manage services that are started up by scripts in the /etc/rc.d/init.d directory.
This command in Linux that allows you to control what services start.
As root, type the following to get a list of all services chkconfig handles:
You see a list of services, use the –list option shows us a sampling of services managed by chkconfig.
1 2 3 4 5 6 7 8 | $chkconfig --list Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. akmods 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
You can use the on the option to have service started at specified runlevels, and the off option to disable it, see below.
1 2 | chkconfig --level 5 httpd on chkconfig --level 5 httpd off |
The structure of command is :
1 | chkconfig --levels <b>levels</b> <b>service</b> <b>switch</b> |
This means:
–levels levels define the run levels in which you want the particular service switch to be turned.
service is the service we want enabled/disabled.
switch is on/off, meaning enabled/disabled.
If you want than reset with the reset option to restores a service.
1 | chkconfig httpd reset |
If you want a service removed entirely from the entire startup and shutdown process in all runlevels than use:
1 | chkconfig --del httpd |
You can also add services to chkconfig management than use this:
1 | chkconfig --add httpd |
Under Ubuntu we have this tool: sysv-rc-conf and the usage is practically identical to chkconfig.
By default, the utility is not installed on Ubuntu.