Adding a startup script on Ubuntu server


Posted by: Marko Tomic in Linux on Feb 12, 2010

Tagged in: ubuntu , Shell , linux , command

This is a useful tip for my reference.  I've been creating some startup scripts on my Ubuntu server lately and her are a couple of steps required to get this working.

Write your startup script and place it in /etc/init.d/ directory. Let's say you called your startup script - myScript.  You then install your script by using update-rc.d debian utility:

update-rc.d myScript defaults

Have a look at man update-rc.d for more info.

And finally, you have to make your file executable:

chmod +x myScript