CentOS Set boot up

Source: Internet
Author: User
Tags svn centos
CentOS two ways to add programs to a service and set the service to start automatically:
The first method: use Chkconfig to configure the boot level
Under CentOS or redhat other systems, if the services are installed behind them, such as httpd, Mysqld, Postfix, and so on, the system will not automatically start after installation. Even if the service is started by manually executing/ETC/INIT.D/MYSQLD start, the system will not start the service automatically as soon as the server restarts.
At this time, we need to set up after the installation, so that the system automatically start these services, to avoid unnecessary losses and trouble.
In fact, the command is very simple, the use of chkconfig can be. For example, to set the mysqld to boot automatically:
#chkconfig mysqld on
Similarly, to cancel a service to start automatically, simply change the last argument "on" to "off". For example, to cancel the automatic start of the postfix:
#chkconfig postfix off
It is noteworthy that if this service has not been added to the Chkconfig list, it is now necessary to add it by using the –a DD parameter:
#chkconfig –add Postfix
If you want to query for all currently autostart services, you can enter:
#chkconfig –list
But this shows too much stuff and looks dizzy. What if you only want to see the specified service? This time only need to add a service name after "–list", such as to see if the HTTPD service is automatically started, enter:
#chkconfig –list httpd
The result of this time output:
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
When 0~6 is off, the HTTPD service does not start automatically when the system starts. After we enter Chkconfig httpd on, we check that the output changes to:
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
This time 2~5 is on, indicating that it will start automatically.

The second method: Configure boot Boot
CentOS belongs to the normal Linux system. Put it under the/etc/rc.d/rc.local to start.
Edit Rc.local This file. Write down the path and the program.
You can do this with the boot from the Apache, MySQL, Samba, SVN, and so on:
1. Edit Rc.local File
#vi/etc/rc.d/rc.local
2, add the following start command
/usr/sbin/apachectl start
/etc/rc.d/init.d/mysqld start
/ETC/RC.D/INIT.D/SMB start
/usr/local/subversion/bin/svnserve-d
3, Note: My path is yum installation of these services to get the path, fill in according to their own installation path, can not find the help of the search command, mainly to find Apachectl, mysqld, SMB these three startup files.
4, note: SVN is not yum installed, find your installation directory in the bin directory under the Svnserve this boot file. Http://www.linuxso.com/linuxpeixun/11560.html
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.