Create an autostartup script for Debian and Ubuntu systems

By | July 31, 2009

In Debian-based distributions (and here I’m also talking about the widely-spread Ubuntu), there is no rc.local file preinstalled. The good thing is that you can make one easily so you can have a place to put commands to be started up automatically at boot. Here’s what you have to do:

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

You can name the new file whatever you want, but in this example we’ll use local.autostart. Paste

#!/bin/sh

on the first line of the file and 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.autostart

Make the file be recognized as an init script:

sudo update-rc.d local.autostart defaults 80

Now, every time you boot up your Debian-based distribution, the commands you set in /etc/init.d/local.autostart will “magically” autostart.

6 thoughts on “Create an autostartup script for Debian and Ubuntu systems

  1. Pingback: HowtoMatrix » Create an autostartup script for Debian and Ubuntu systems

  2. Pingback: X L A B » Blog Archive » Debian b?z?tu distribut?vu programmu autostarta skripts

  3. Pingback: How to setup startup scripts in Ubuntu « Linux & Stuff

  4. Pingback: ???? ????? ???? ??????? ?? ?????? ? ?????? | ????????

  5. Risame

    FINALLY!!!! A solution that works =D!!!!
    Been fighting with making a script that used sudo autorun at start following a lot of tutorials and none of them worked >.>
    Thanx again, you’re my hero xD

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *