Set the CentOS service startup sequence

Source: Internet
Author: User
As we know, in the CentOS system, the startup script of the system service is generally stored in the/etc/init. d Directory. Different boot modes correspond to the/etc/rcx. d Directory respectively. In fact, files on/etc/rcx. d are generally linked to the corresponding files under the/etc/init. d Directory. We also know that/etc/rcx. the file name under d is in the S + number or K + number headers. Here, S indicates start, K indicates close, and the value following it indicates service start or service exit.

As we know, in the CentOS system, the startup script of the system service is generally stored in the/etc/init. d Directory. Different boot modes correspond to the/etc/rcx. d Directory respectively. In fact, files on/etc/rcx. d are generally linked to the corresponding files under the/etc/init. d Directory. We also know that/etc/rcx. the file name under d is in the S + number or K + number header. Here, S indicates start, and K indicates close, the value following it indicates the order in which the service is started or exited. So how are these values? Do you need to modify the file name in/etc/rcx. d? The answer is No. What should we do?

Open the script under/etc/init. d and look for a sentence similar to the following:

# Chkconfig: 2345 64 36

Here 64 is the start sequence value, and 36 is the exit sequence value. if you need to change the sequence, change it here. Then run the following command:

# Chkconfig -- del servicename

# Chkconfig -- add servicename

# Chkconfig servicename on

 

Servicename corresponds to your service name.

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.