Howto create an autostartup script for Debian and Ubuntu systems

On September 18, 2009, in Uncategorized, by Dipin Krishna
You can make one autostartup script for ubuntu(debian) easily, and put commands to be started up automatically at boot. Here’s what you have to do:

sudo nano /etc/init.d/local.startup

You can name the new file whatever you want, but in this example i haveused local.startup. Type


#!/bin/sh

on the first line of the file.
Now type your command(s) underneath, one after the other. Now save and close and make the file executable with


sudo chmod +x /etc/init.d/local.startup

Make the file to be recognized as an init script:


sudo update-rc.d local.startup defaults 80

Now when you restart you will have the commands in the file auto started.

Tagged with:  

2 Responses to “Howto create an autostartup script for Debian and Ubuntu systems”

  1. Cassiano Leal says:

    You can also just append your commands to the end of /etc/rc.local . Can't get any easier than that:- Open /etc/rc.local in a text editor;- Type in your commands one after the other;- Save the fileOn the next reboot, your commands will be run.

  2. Stephan Beal says:

    You can also add commands by symlinking them under /etc/rc#.d, e.g.:cd /etc/rc2.d # 2 == runlevel 2ln -s /path/to/script S80scriptthat will run /path/to/script when runlevel 2 is starting up.

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...