Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have written a command line C application that I need to run every time the system starts up. How would I go about doing this? I have seen other questions and answers that show ways to do this for pre-installed software via visual menus but this is just a custom written binary that I need to make sure runs after every reboot. Is there any way I can do this, or must I write a shell script that runs the binary and find a way to add that to the scripts that get run at startup? I am running on 10.04.

share|improve this question
    
you have to run this app as root or as a normal user ? –  user827992 Jul 18 '12 at 11:56
    
my login is disabled so I autologin as myself and run as such - no running as root is needed –  mathematician1975 Jul 18 '12 at 12:00

3 Answers 3

up vote 1 down vote accepted

Assuming this can run at the very end of the boot process, you can either just include it in /etc/rc.local or use the special cron @reboot parameter and put it in the user or system (root) crontab, depending on the privileges it needs.

share|improve this answer
    
that has done the trick - thanks –  mathematician1975 Jul 18 '12 at 13:47

There are couple of ways. All based on what permission you require,

Easiest one is as follows,

The following is tutorial for - Open startup applications from the power cog
powercog

Click on ADD

add-button

Then provide the details,

add-dialog

share|improve this answer
    
He said its a CLI system IIRC? –  izx Jul 18 '12 at 13:38

If you want to execute something each time you are logged in you have to modify your local

~/.profile 

If you want to execute something each time you start a login shell you can modify your

~/.bashrc

In you case you have to add your executable to .profile and drop a new line for it, remember to add a & at the end to run this application as a separate process.

Something like

/usr/bin/gedit &
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.