Rc.local Script
The rc.local script is a script that will be executed automatically after Ubuntu is powered on, and we can add command-line directives to the script. The script is located under the/etc/path and requires root permission to be modified.
The script is specific in the following format:
#!/bin/sh-e # # rc.local # # This script is executed in the end of each
multiuser runlevel.
# Make sure that script would ' exit 0 ' on success or any other
# value On error.
# in order to
-enable or disable this script just change the execution
# bits.
# by
Default this script does nothing.
Exit 0
Note: Be sure to add the command before exit 0
How to add a boot up script to Ubuntu
1, create a new script file new_service.sh
#!/bin/bash
# command content
exit 0
2, set permissions
sudo chmod 755 new_service.sh
3, put the script in the boot directory
sudo mv new_service.sh/etc/init.d/
4, add the script to the startup script
Execute the following instruction, where 90 indicates a priority, the higher the later the execution
cd/etc/init.d/
sudo update-rc.d new_service.sh defaults 90
Remove Ubuntu Boot script
sudo update-rc.d-f new_service.sh Remove
Summarize
The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.