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

I have a stand alone server application that I would like to run automatically when my red hat box starts up. My default run level is 5 but I want to make sure it works both in run level 3 & 5.

Answers appreciated!

share|improve this question
up vote 4 down vote accepted

There's /etc/rc.d/rcX.d directory for each runlevel X. Symlink apropriate [S]tart and/or [K]ill scripts to /etc/rc.d/rc3.d/ and /etc/rc.d/rc5.d

The scripts are run as sorted by number. This way you can organize dependencies.

The scripts per se are in /etc/init.d/

share|improve this answer
    
Also - on BSD (inherited by Slackware), runlevels are actually found in /etc/rc.d/rc.* - that is strictly a Debian/RH view of things. – new123456 Apr 29 '11 at 21:04

You can also use chkconfig

Example:

chkconfig [servicename] on

This normally actives the service on runlevel 3 and 5.

share|improve this answer
    
+1, I liked this when still using Red Hat / Fedora. It's not available on other distros than RH-based ones, is it? – Jonik Jul 30 '09 at 18:59
1  
It is available on Ubuntu and on Cent-OS. I use it regularly. – BinaryMisfit Jul 30 '09 at 19:04
    
Ah, so it seems; packages.ubuntu.com/jaunty/chkconfig. Cool! – Jonik Jul 30 '09 at 19:08

You must log in to answer this question.

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