How to create an Automatic startup script for Ubuntu

Source: Internet
Author: User
1) copy your startup script to the/etc/init. d directory and assume that your script file name is test. 2) set the permission for the script file $ sudochmod755/etc/init. d/test3) run the following command to put the script into the Startup Script: $ cd/etc/init. d $ sudoupdate-rc.dtest & n 1) copy your startup script to the/etc/init. d directory. Assume that the file name of your script is test.
2) set the permission for the script file $ Sudo chmod 755/etc/init. d/test
3) execute the following command to put the script into the startup script: $ Cd/etc/init. d $ Sudo update-rc.d test defaults 95 Note: The number 95 indicates the sequence number started by the script. You can modify the sequence number as needed. When you have multiple startup scripts and dependencies between them are successively started, you will know the specific functions of this number. The output information of this command is as follows:
update-rc.d: warning: /etc/init.d/test missing LSB information
update-rc.d: see
Adding system startup for /etc/init.d/test ...
/etc/rc0.d/K95test -> ../init.d/test
/etc/rc1.d/K95test -> ../init.d/test
/etc/rc6.d/K95test -> ../init.d/test
/etc/rc2.d/S95test -> ../init.d/test
/etc/rc3.d/S95test -> ../init.d/test
/etc/rc4.d/S95test -> ../init.d/test
/etc/rc5.d/S95test -> ../init.d/test

How to uninstall the startup script: $ Cd/etc/init. d $ Sudo update-rc.d-f test remove command output information is as follows:
Removing any system startup links for /etc/init.d/test ...
/etc/rc0.d/K95test
/etc/rc1.d/K95test
/etc/rc2.d/S95test
/etc/rc3.d/S95test
/etc/rc4.d/S95test
/etc/rc5.d/S95test
/etc/rc6.d/K95test

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.