Skip to content

Auto-start a shell script on Ubuntu Server

by Jonathon on April 23rd, 2009

Got a shell script that you want automatically run at bootup on Ubuntu Server Edition? Here’s how:

  1. Create a script in the /etc/init.d/ directory
  2. Make the script executable
    $ sudo chmod +x /etc/init.d/myscript.sh
  3. 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.

Referenced from:

From → Notebook

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS