CentOS set up the program to start the Automatic boot command introduction

Source: Internet
Author: User

1. The default for System Services program Boot boot method

For example: MYSQLD,HTTPD, etc.

You can use the command directly

Chkconfig mysqld on so that you can start MySQL on the boot.

2. is not a system service, requires a command-initiated

Direct Edit/etc/rc.d/rc.local

Add the Start command at the bottom line. For example:

The code is as follows Copy Code

Su-svn-c "svnserve-d--listen-port 9999-r/opt/svndata"//So boot can automatically start Svnserver.


1, the start of the program to add the command to the/etc/rc.d/rc.local file, such as the following is the setting up boot httpd.

The code is as follows Copy Code

#!/bin/sh
#
# This script would be executed *after* all the other init scripts.
# You can put your own initialization stuff with If you don ' t
# want to does the full Sys V style init stuff.

Touch/var/lock/subsys/local
/usr/local/apache/bin/apachectl start

2, add the written startup script to the directory/etc/rc.d/init.d/, and then use the command chkconfig to set the boot up.
For example: We write the httpd script and put it into the/etc/rc.d/init.d/directory, using

The code is as follows Copy Code
Chkconfig--add httpd
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.