Method 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 point, only need to set up after installation, let the system automatically start these services, to avoid unnecessary loss and trouble.
You can use Chkconfig. For example, to set the mysqld to boot automatically:
#chkconfig mysqld on
In the same vein, to cancel a service auto-start, you only need to change the last parameter "on" to "Off". For example, to cancel the auto-start of postfix:
#chkconfig postfix off
Note that if the service has not been added to the Chkconfig list, it is now necessary to add it using the –add parameter:
#chkconfig –add Postfix
To query all currently started services automatically, you can enter:
#chkconfig –list
To view the specified service, simply add the service name after "–list", such as checking whether the httpd service is started automatically:
#chkconfig –list httpd
Output Result:
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. After we enter Chkconfig httpd on, check again that the output is changed to:
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.
Method 2, configure boot boot, configure the boot-up script in the rc.local file.
This approach can be done with the boot-up issues for Apache, MySQL, Samba, SVN, and other services:
1. Edit the Rc.local file
#vi/etc/rc.d/rc.local
2. Join the 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: This path is the path of yum installation, when filling in according to the installation path, can not find the use of the Find command, mainly to find the Apachectl, mysqld, SMB three boot files.
4. Note: SVN is not a Yum installation, find the boot file in the bin directory of the installation directory Svnserve.
Two ways to start the CentOS boot setup