Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct way (if possible distribution agnostic) to start application automatically in Linux (Debian Wheezy)? In need to know two things. How to autostart generally, so that the application runs in background even before I log in, and the userspecific autostart, meaning the application gets started as soon as the user logged in.

share|improve this question
up vote 1 down vote accepted

The standard way to start processes on system startup is using a script in /etc/init.d. There should be a template in the directory. These need to be linked to the appropriate /etc/rcX.d directories. man pages for the required command should be already installed.

upstart is newer way to get init to start a process when the server starts. If this is available the command man upstart should give you documentation.

Starting commands when you login can be done in your .profile. You will want to end the commands with a & so that they run in the background.

share|improve this answer
Depending on the shell, it is probably ~/.bash_profile, just to avoid any confusion for @DevNoob. BillThor has you off to a great start. – nerdwaller Nov 20 '12 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .