Thursday, July 28, 2011

How to make a startup script in ubuntu

Create a Startup Script in Ubuntu
Step 1
Make a script as you need .(example vtest.sh)

Step 2
Copy that file(vtest.sh) to /etc/init.d directory.

Step 3
run follwing command to make the permission of the file.
sudo chmod +x /etc/init.d/vtest.sh

Step 4
run follwing command to add script to startup
sudo update-rc.d vtest.sh defaults


OK you are done :-).Now restart the machine & It ll run the script at startup.

When you want to remove it from Startup
run following command
update-rc.d -f vtest.sh remove

2 comments:

  1. nice explanation!!!
    but you can do it in a easier way.
    1.system>preferences>startup applications
    2.add new item
    3.give name
    4.give path to your application
    5.give comment if you want
    you are done!!!

    ReplyDelete