Chkconfig is frequently used in command line operations. It allows you to conveniently set the services started at the running level of each system. You can easily manage your startup services.
To list the startup status of all services in the system:
# Chkconfig-list
To list the mysqld service settings:
# Chkconfig-list mysqld
Set mysqld to be used for startup at levels 3 and 5:
# Chkconfig-level 35 mysqld on
-Level 35 indicates that the operation is only executed at levels 3 and 5.
On indicates start, off indicates close
Set mysqld to on:
# Chkconfig mysqld on
"Each level" includes 2, 3, 4, and 5 levels
Level 0: Shutdown
Level 1: Single User Mode
Level 2: multi-user command line mode without network connection
Level 3: multi-user command line mode with network connection
Level 4: unavailable
Level 5: multi-user mode with graphic interface
Level 6: restart
How to add a service:
First, the Service script must be stored in the/etc/INI. d/directory;
Second, you need to use chkconfig-add servicename to add this service to the chkconfig tool service list. In this case, the service will be stored in/etc/rc. d/rcN. d.
Finally, you can modify the default startup level of the service as instructed above.
Delete A service:
# Chkconfig-del servicename