Solution to service redis does not support chkconfig

Source: Internet
Author: User

The solution is as follows:

You must put the following two lines of comments in the front of the/etc/init. d/redis file:

# Chkconfig: 2345 90 10

# Description: redis is a persistent key-value Database

 

 

The above comment indicates that the redis service must be started or shut down under runtime Level 2, 3, 4, 5. The priority of startup is 90, and the priority of shutdown is 10.

 

Appendix: Linux running level

The running level is the current running function level of the operating system. This level ranges from 0 to 6 and has different functions. These levels are specified in the/etc/inittab file. This file is INITProgramThe first service to run is the files in the/etc/rc. d directory.

Different runtime levels are defined as follows: (refer to/etc/inittab in Linux)

 

# The default running level. RHS uses the following levels:

0: Shutdown

1: single-user mode

2: multi-user mode without network support

3: multi-user mode with network support

4: reserved, not used

5. Multi-user mode with network support and X-window support

6. reboot the system.

 

Detailed explanation of each running level:

 

0 indicates that the machine is shut down.

1 is the single-user mode, just like the security mode in Win9x.

2: multi-user mode, but not supported by NFS.

3 is a complete multi-user mode, which is a standard operation level.

4. Generally, you can use it to do things in some special cases. For example, you can switch to this mode to make some settings when the battery of your laptop is exhausted.

5 is X11, And it enters the X Window System.

6. Restart the init 6 server.

 

Chkconfig usage

The chkconfig command can be used to check and set various services of the system.

Syntax:

Chkconfig [-- add] [-- del] [-- list] [System Service] Or chkconfig [-- level <level code>] [System Service] [ON/OFF/Reset]

 

Parameter usage:

-Add adds the specified system service, enables the chkconfig command to manage it, and adds relevant data in the system startup description file.

-Del: deletes the specified system service. It is no longer managed by the chkconfig command, and relevant data is also deleted in the description file started by the system.

-Level <level code> specifies the execution level of the read system service.

 

Example:

Chkconfig-list all system services

Chkconfig-add redis to add redis services

Chkconfig-del redis Delete redis Service

Chkconfig-level redis 2345 on sets redis to on (Enabled) when the running level is 2, 3, 4, and 5.

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.