Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the difference between boot sequence rc.local and chkconfig

Shulou Source: shulou.com Published: 2022-06-01 03:32:50 09月11日 Update

This article shows you the difference between boot sequence rc.local and chkconfig. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The / etc/rc.local file has the following two lines

/ etc/init.d/mysql start

/ etc/init.d/keepalived start

/ etc/rc.local starts one in the order of the script and then starts the next. Start mysql first and then start keepalived

The chkconfig information is as follows

[root@localhost log] # chkconfig-- list | grep mysql

Mysql 0: on 1: on 2: on 3: on 4: on 5: on 6: on

[root@localhost log] # chkconfig-- list | grep keepalived

Keepalived 0: on 1: on 2: on 3: on 4: on 5: on 6: on

[root@localhost rc3.d] # ll | grep mysql

Lrwxrwxrwx 1 root root 15 Sep 14 08:36 S64mysql->.. / init.d/mysql

[root@localhost rc3.d] # ll | grep keep

Lrwxrwxrwx 1 root root 20 Sep 14 08:36 S21keepalived->.. / init.d/keepalived

Chkconfig depends on the running level.

For example, in the case of init 3, you can check / etc/rc3.d, which starts with S, that is, the number after start is the order. For example, if 21 is before 64, you need to start keepalived first.

The startup sequence is clear, and there is a little personal understanding.

Rc.local or chkconfig will not wait for the last service to start successfully before starting the next service, but will pass the instructions to one service in the startup order and then to the next service, regardless of how long it will take for the service to start successfully.

For example, it takes 5 minutes for A to start and 1 minute for B to start. In rc.local or chkconfig, the order of An is in front of B. it is true that A starts first and then B starts, but B may start first because B has a short time.

If this is not the case, the previous service will not start successfully, the later service will not start, and the operating system will not be so stupid.

The above is the boot sequence what is the difference between rc.local and chkconfig, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Order service success that is content skills knowledge concise operating system concise so that personal information beginning situation instructions numbers files articles time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MySQL NVidia Docker Linux