Linux Setup Boot service auto start

Source: Internet
Author: User

Linux Setup Boot service auto start  [[email protected] ~]# chkconfig--list     Show services that can be started automatically on boot  [[email  Protected] ~]# chkconfig--add * * * Add power on auto Start * * * * Service  [[email protected] ~]# chkconfig--del * *   Delete boot auto start * * Services    www.2cto.com  [[email protected] ~]# setup     commands that can be configured in the Shell graphics terminal, go to service to select  [[email protected] ~]# ntsysv     in shell Terminal graphics Configuration Boot service command, options not above that much   setup, rc.local And chkconfig three ways can be set    first)   Enter #setup command into the System service menu, select the services you want to start such as httpd, and then restart the machine or/etc/rc.d./init.d/httpd    start   www.2cto.com   second)   put the start command in the/etc/rc.d/rc.local file so that you can start the service automatically every time you start, For example, Apache, after compiling Apache, will generate the Apachectl file under the bin of the installation directory, this is a startup script, we just need to add this command to Rc.local (SuSE has no rc.local. SuSE can define its own scripts so that if you want to run your own scripts before and after switching the run level, you can create them separately:  /etc/init.d/before.local /etc/init.d/after.local)  echo/usr/local/apache/bin/apachectl>>/etc/rc.d/rc.local,  The way to set up the service to start automatically is to include some scripts like the following in Rc.local:  #sshd /usr/local/sbin/sshd   #proftpd  /usr/local/sbin/proftpd   #apache  /home/ Apache/bin/apachectl start   #mysql  /home/mysql/bin/safe_mysqld--port=3306 &   #start Oracle8i listener first su-oracle-c ' lsnrctl start '   #start oracle8i su-oracle-c ' Dbstart '    The third kind   through chkconfig instruction .  uses the Chkconfig command to add a service to the system's various runlevel, the steps are as follows,  1 creates the startup script .   for Apache,mysql, SSH Such software is self-brought, we just have to modify a little bit to support chkconfig can be  2 modify the script   we need to add 2 lines before the script to support chkconfig command  # chkconfig: 2345 92 # # description:automates A packet filtering firewall Withipchains. #  chkconfig: The subsequent definition of the runlevel that enables the service to start (for example, the 2345 start service), and the order in which the services are closed and started (the order in which the services are turned off in the example above 8, the order in which they are started)  descriptions: Description of the change service (IPChains packet filtering in the above example) , you can switch to your own desired    modify and execute  CP your script/etc/rc.d/init.d/script name  chmod 700/etc/rc.d/init.d/script name   Chkconfig--add script name   such as:  to add it to the Linux boot process, run only at level 3, Levels 5,  [[email protected] INit.d]/sbin/chkconfig--add apache-httpd [[email protected] Init.d]/sbin/chkconfig--level 35 After apache-httpdon , we will automatically start and close our service every time we restart the server.

Linux Setup Start-up service starts automatically

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.