How to add custom scripts to auto-start upon startup

Source: Internet
Author: User

My machine has a coreseek service, but it is not added to start. As a result, once the machine room restarts, my service cannot be used. So I need to add the searchd of coreseek to the self-starting service.

Write a script auto_coreseek.sh:
#! /Bin/sh # chkconfig: 2345 80 90 # Description: auto_coreseek/usr/local/coreseek/bin/searchd

 

Put it in/etc/init. d/auto_coreseek.sh, then chmod + x/etc/init. d/auto_coreseek.sh, and then add it to start: chkconfig -- add auto_coreseek.sh. Then, we will study this. Chkconfig has several levels: 0: Indicates shutdown 1: indicates single-user mode 2: Indicates multi-user command line mode without network connection 3: Indicates multi-user command line mode with network connection 4: indicating unavailability 5: Indicates multi-user mode with graphic interface 6: Indicates restarting so chkconfig: 2345 indicates that the 80 and 90 after the service is started at the 2345 level indicate the priority of the program, and the priority is also well understood, is the order in which the program is executed by the CPU. The smaller the value, the higher the limit. So the starting priority and closing priority here mean the starting priority of the script process and the closing priority of the script process.

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.