Centos auto-start

Source: Internet
Author: User

In centos, you can set your own installation methods.ProgramStart the instance.
1. Add the Startup Program command to the/etc/rc. d/rc. Local file. For example, set httpd to be started upon startup.

  1. #! /Bin/sh
  2. #
  3. # This script will be executed * after * all the other init scripts.
  4. # You can put your own initialization stuff in here if you don't
  5. # Want to do the full sys V style init stuff.
  6.  
  7. Touch/var/lock/subsys/local
  8. /Usr/local/Apache/bin/apachectl start

2. Add the prepared STARTUP script to the/etc/rc. d/init. d/directory, and run the command chkconfig to set the startup.
For example, we write the httpd script and put it in the/etc/rc. d/init. d/directory.

  1. Chkconfig -- add httpd
  2. Chkconfig httpd on

The command is set to boot.

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.