(ii) Redis Installation and configuration (3)---Registration service and auto-start

Source: Internet
Author: User

Registration Services

The so-called registration service is a system service that turns a program into Linux and gives the gateway to shutdown and launch at the specified runlevel.


Redis does not support service registration by default and will error.

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/83/17/wKioL1dqePrBUWk7AAAsDXoPjZM953.jpg-wh_500x0-wm_3 -wmp_4-s_3198806975.jpg "title=" 1.jpg "alt=" Wkiol1dqeprbuwk7aaasdxopjzm953.jpg-wh_50 "/>

in the copy to/etc/rc.d/init.d/in theRedisScripthave been modified as follows (previously copied): Join chkconfig:2345. 2345 is the RunLevel, which tells the Chkconfig program that it needs to be in rc2.d,rc3.d,rc4.d, and rc5.d directories created asS90redisa link to a file, linked to/etc/rc.d/init.dunder the directoryRedisscript. The first character is aS, you add aStartparameter tells the script that this is a startup mode. At the same timeRc0.dand theRc6.dunder Directory, create a name ofK10redisthe file link can be a character ofK, which means that the system runs the script when it is closed, adding aStopThe parameter tells the script that it is now off mode.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/83/17/wKiom1dqeQPwzus_AACMsr2AwPM058.jpg-wh_500x0-wm_3 -wmp_4-s_955077204.jpg "title=" 2.jpg "alt=" Wkiom1dqeqpwzus_aacmsr2awpm058.jpg-wh_50 "/>

If you register again, you will get an error.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/83/17/wKioL1dqeQzTkdkuAAAtKl5uipk865.jpg-wh_500x0-wm_3 -wmp_4-s_3709559688.jpg "title=" 3.jpg "alt=" Wkiol1dqeqztkdkuaaatkl5uipk865.jpg-wh_50 "/>

Let's take a look at the files inside the rc2.d (as well as other rc3-5.d) , such as:

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/83/17/wKioL1dqeRXgwRftAAEE_cHeLc8849.jpg-wh_500x0-wm_3 -wmp_4-s_2505283162.jpg "title=" 4.jpg "alt=" Wkiol1dqerxgwrftaaee_chelc8849.jpg-wh_50 "/>

In fact , this 90 or ten of these 2 numbers are custom, the number is not OK after all, the overall name is different.


Note that: After registering the service does not equal to the 2,345 level will automatically start, just say at level 2,345 can automatically start, how to set up automatic start also need to use the following command:

Chkconfig--level Redis on #一般只会设置成35级别自动启动, will not set 2345

The purpose of the registration service is also to make the management more convenient, we can use the following command to start or stop the process at any time:

Service Redis Start/stop


To summarize:

    • The real script is inside the/ETC/RC.D/INIT.D , and the/etc/rc0-6.d inside is the link file, the link is /etc/rc.d/init.d Inside the real script program.

    • RC0-6.D corresponds to 7 different operating levels

    • The naming rules for linked files are s+ numbers + service names or K + numbers + service names, and s means that start,k represents kill.

    • The system will find the corresponding RCN.D file according to the startup level of the set, then go to execute the link file, the start of the current running level is the beginning of the program, and K means that it needs to be stopped.

This article is from the "Little Demon's Home" blog, so be sure to keep this source http://littledevil.blog.51cto.com/9445436/1791895

(ii) Redis Installation and configuration (3)---Registration service and auto-start

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.