CentOS uses Chkconfig management system services default startup or not

Source: Internet
Author: User

first of all, we need to know some of the running levels of Linux programs Run-level

Level 0 means: shutdown
Level 1 means: Single user mode
Level 2: Multi-user command line mode with no network connection
Level 3 means: Multi-user command line mode with network connection
Level 4 means: Some distributions of Linux use this level to enter the X Windows system
Level 5 means: Multi-user mode with graphical interface
Level 6 means: reboot

Changes to the run level can be toggled with the init command. For example, if you want to maintain the system into a single-user state, you can use init to switch. During the switching process of Linux running level, the system will automatically find files corresponding to the/etc/rc[0-6].d of K and S under the directory of Run level, and execute these scripts in the following numerical order. The maintenance of these scripts is a tedious thing, Linux provides the chkconfig command to update and query system services at different run levels.

Chkconfig This program can be/etc/rc.d/init.d/inside the executable service and/ETC/XINETD.D inside the related executable services, link to your designated run-level.

Note :/etc/init.d/is a link to/etc/rc.d/init.d/, such as an experiment:

How to use Chkconfig

# chkconfig [--level levels] [--list|add|del] [service name]
Parameter description:
--level: The same explains the different run-level can be set!
--list: List Run-level If the package name is on boot?!
--add: Add a service_name to start the boot;
--del: Delete a boot-start service!
Service Name: This must actually exist in the/ETC/RC.D/INIT.D directory.

Common commands:

List all services managed by chkconfig on the current system
# chkconfig--list

List the run level of a service
# chkconfig--list MySQL

Displays services that are currently started at run Level 3
# chkconfig--list | grep ' 3:on '

Add a service that uses Chkconfig management
# chkconfig--add MySQL

Enable MySQL to start service/Shut down service at 2345 RunLevel
# chkconfig MySQL on
# chkconfig MySQL off

Let the MySQL service start when the run level is 3:
# chkconfig--level 3 MySQL on

Comprehensive usage Examples:

References:

    • System Settings Common directives
    • Understanding System Services (Daemons)

CentOS uses Chkconfig management system services default startup or not

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.