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.

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

2 Answers 2

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. –  Diago Jul 30 '09 at 19:04
    
Ah, so it seems; packages.ubuntu.com/jaunty/chkconfig. Cool! –  Jonik Jul 30 '09 at 19:08

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.