Created
March 20, 2013 07:15
-
-
Save kacinskas/5202876 to your computer and use it in GitHub Desktop.
Auto-start a shell script on Ubuntu Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Got a shell script that you want automatically run at bootup on Ubuntu Server Edition? Here’s how: | |
Create a script in the /etc/init.d/ directory | |
Make the script executable | |
$ sudo chmod +x /etc/init.d/myscript.sh | |
Make the script start at bootup | |
$ sudo update-rc.d myscript.sh defaults | |
Note: the option “defaults” puts a link to start your script in runlevels 2, 3, 4 and 5, and puts a link to stop in runlevels 0, 1 and 6. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment