Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Where does Linux look to start programs on startup? (In Windows we have the registry)

share|improve this question

migrated from stackoverflow.com May 14 '10 at 20:59

This question came from our site for professional and enthusiast programmers.

5 Answers 5

On most Linux distributions this is accomplished via runlevels and the rc.d directory:

http://www.linux.com/archive/feature/114107

share|improve this answer

It depends on your linux distribution. Basically you create an init script and setup symlinks. The location and names of the symlinks highly depend on your distribution.

Most distributions have utilities to manage the symlinks: rc-update on Gentoo, update-rc.d on Debian

share|improve this answer

Do you want it to start as part of the initialization process, or on a per-user basis?

If you want it to run during init, the previous answers indicating how to create scripts in rc.d are sufficient.

If you want it to run on a per-user basis, you can add commands to your .bash_profile (or similar) for command-line tools.

For GUI-based tools, Gnome (under Ubuntu 10.10) has the following settings you can play with:

System -> Preferences -> Startup Applications

sysprefs

share|improve this answer

in linux (debian , ubuntu , openSUSE and most of the linux distros) we have the directories /etc/cron.d , /etc/cron.dayly

if you put a bash script on /etc/crond.d it will start wen the system starts,

(don't forget to chmod 777 myfile.sh)

share|improve this answer

init (short for initialization) is the program on Unix and Unix-like systems that spawns all other processes. It runs as a daemon and typically has PID 1.

Wikipedia - Init.

share|improve this answer
    
"init" is the most suggestive keyword here, even without being wrapped into a link to wikipedia. It's a shame to see that the SO ecosystem is starting to rot because of inadequate karma abusing downvoters. It will be a pity if people will start leaving because of this, since downvotes without reasons are certainly not motivating to keep helping others. –  vtest Nov 1 '10 at 16:28
    
@vtest: Not downvoting (although I'm sorely tempted to), but I suspect the reason for the downvotes on this answer is that it does not address the question in any meaningful way. Yes, init is the first process started, but neither the copy/pasted text nor the linked article tells the uninitiated how anything else gets set to run on startup. –  Dave Sherohman Jan 24 '11 at 11:13

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.