Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I need to start a process when our linux/unix boxes (These boxes are used as build agents) are starting (ie: after a reboot). We use the following distros:

  1. debian 6
  2. ubuntu 12.something
  3. FreeBSD
  4. CentOS 6
  5. Suse 12.something :)

Can you please let me know what should I make in order for this to happen?

Thank you, f.

share|improve this question

The easiest way would be to put your command in /etc/rc.d/rc.local. The rc.local script is run after all the other System V init script are done.

share|improve this answer

In general the same process should work for all those distro's but you might have to tweak them to suit their specific implementation.

Have a look at "run levels", determine at which level you want to start your scripts (usually 3 for a server and 3 & 5 for a graphical client) and then follow this:

In a nutshell, you create your startup script (best copy and modify an existing one - for the sake of example call it "myScript") and place it in /etc/init.d. Then in /etc/init.d/rcX.d (where X is your run level) place links to the script you put in /etc/init.d. The links should be named SxxmyScript and KxxmyScript. The "S" links get followed on startup - i.e. when the system enters that runlevel, and the "K" links get executed when the system exits that runlevel.

More recent distributions use services which are a more elegant twist on the above, but the above should work.

Also, for completeness look at /etc/inittab. This isnt available on all distributions (i.e. ubuntu) but should be present on SuSE. This is a proper old throwback but is still very much used these days in older environments.

share|improve this answer

Your Answer


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.