CentOS Setup service boot up

Source: Internet
Author: User

    • Linux
How to start the CentOS Setup service

by Tianya · 2013/07/26

Two ways to boot the CentOS Setup service

1, use Chkconfig to configure the boot level
In the case of CentOS or redhat other systems, the system will not start automatically after installation, such as httpd, mysqld, postfix, etc., if the service is installed later. Even if the service is started manually by/etc/init.d/mysqld start, the service will not start automatically as long as the server restarts. At this time, we need to set up after installation, let the system automatically start these services, to avoid unnecessary loss and trouble. In fact, the command is very simple, use chkconfig can.
[Tianya PHP Blog]-[http://blog.phpha.com]
For example, to set the mysqld to boot automatically:

1 Chkconfig mysqld on

To cancel a service auto-start, simply change the last parameter "on" to "off".
For example, to cancel the auto-start of postfix:

1 Chkconfig postfix off

It is important to note that if the service has not been added to the Chkconfig list, it is now necessary to add it using the –-add parameter:

1 Chkconfig –add postfix

If you want to query all currently started services automatically, you can enter:

1 Chkconfig- list

If you just want to see the specified service, just add the service name after "–-list", such as checking if the httpd service is started automatically:

1 Chkconfig –list httpd
1 httpd 0:off 1 : off 2:off 3: Off 4:off 5:off 6:off

When the 0~6 is off, the HTTPD service does not start automatically when the system starts. We enter:

1 Chkconfig httpd on

Then this is:

1 httpd 0:off 1:off 2:on 3:on 4 :on 5:on 6:off

This time the 2~5 is on, which indicates that it will start automatically.

2, modify/etc/rc.d/rc.local this file:
For example, Apache, MySQL, Samba, SVN, and other services to start the boot problem together:

1234567 [Tianya PHP Blog ]-[http://blog.phpha.com] vi /etc/RC. D/RC. Local #添加以下命令/usr/sbin/apachectl start /etc/RC. D/init. D/mysqld start /etc/RC. D/init. D/SMB start /usr/local/subversion/bin/svnserve -D

CentOS Setup service boot up

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.