2

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!

Axxmasterr
  • 7,858
  • 7
  • 41
  • 60

2 Answers2

4

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/

Tadeusz A. Kadłubowski
  • 2,195
  • 2
  • 22
  • 27
  • 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
2

You can also use chkconfig

Example:

chkconfig [servicename] on

This normally actives the service on runlevel 3 and 5.

BinaryMisfit
  • 20,643
  • 10
  • 67
  • 76