Ubuntu Add boot Boot Execute script

Source: Internet
Author: User
ubuntu Add boot boot execute script method One: Edit the Rc.loacl script

Ubuntu will execute the script in the/etc/rc.local file after boot,
So we can add the startup script directly to the/etc/rc.local.
Of course to add to the statement: Exit 0 before the line.
Such as:

sudo vi/etc/rc.local

Then, add the scripting code before exit 0. method Two: Add an Ubuntu boot-up service

First copy or soft connect the script to the/etc/init.d/directory, assuming I create a start-zk.sh file in the current directory for the boot zookeeper. Note Start with #!/bin/bash:

Grant file start-zk.sh file executable permissions

CHOMD +x start-zk.sh

Execute the command to add the script to the queue in which the execution was initialized:

UPDATE-RC.D start-zk.sh Defaults

Ways to uninstall Startup scripts

CD/ETC/INIT.D
sudo update-rc.d-f start-zk.sh remove

UPDATE-RC.D Command Reference: http://blog.csdn.net/shb_derek1/article/details/8489112

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.