CentOS Setup Boot from boot

Source: Internet
Author: User

under the CentOS system, there are two main ways to set up your own installed programs to boot. 1, add the command of the startup program to the/etc/rc.d/rc.local files, such as the following is the Setup boot httpd. Copy Code #!/bin/sh## This script would be executed*after*All the other init scripts.# You can put your own initialization stuffinchHereifYou don'T# Want to DoThe full Sys V style init stuff. Touch/var/Lock/subsys/Local/usr/local/apache/bin/apachectl Start Copy Code2, add a well-written startup script to the directory/etc/rc.d/init.d/, and then use the command chkconfig to set the boot up. Chkconfig function Description: Check, set the various services of the system. Syntax: chkconfig [--add][--del][--list][system service] or Chkconfig [--level < class code >][system Services][on/off/Reset]--Add Service--del Delete Service--list to view the startup status of each service such as we set up self-booting MySQL: Copy code1#将mysql启动脚本放入所有脚本运行目录/etc/rc.d/in Init.d2cp/lamp/mysql-5.0. A/support-files/mysql.server/etc/rc.d/init.d/mysqld3  4#改变权限5Chown root.root/etc/rc.d/init.d/mysqld6  7#所有用户都可以执行, only root can be modified8chmod755/etc/rc.d/init.d/mysqld9 Ten#将mysqld put into the Linux boot management system OneChkconfig--Add mysqld A  -#查看全部服务在各运行级状态 -Chkconfig--List Mysqld the  -#只要运行级别3启动, the others are off -Chkconfig--levels245mysqld off copy code for example: we write the httpd script and put it in./etc/rc.d/init.d/directory, using Chkconfig--the Add httpdchkconfig httpd on command is set to boot. 3, add the command of the startup program to the/etc/rc.d/scripts in Rc.sysinit files/etc/rc.d/Rc.sysinit, complete the system service program startup, such as System environment variable settings, set the system clock, load fonts, check the loading file system, generate system boot information log files, such as we set the self-start Apache:echo"/usr/local/apache2/bin/apachectl Start">>/etc/rc.d/rc.sysinit

Note: Transfer from http://www.cnblogs.com/xlmeng1988/archive/2013/05/22/3092447.html

CentOS Setup Boot from 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.