Server Fault is a question and answer site for system and network administrators. 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

As the question is clear from the title, how do I change Linux services startup/boot order?

share|improve this question
up vote 5 down vote accepted

You can change the order by renaming the symlinks under /etc/rcX.d/ where x will be your run level.

You'll see a bunch of files starting with Sxx or Kxx. S links are traced during startup while the K ones are parsed for shutdown. The xx here represents the order.

But this order is set for a reason, so be careful while changing them.for example. ntpd should start only after the networking subsystem is initialized.

share|improve this answer

You want to read a little about your runlevels and rc.d directories. Inside the rc.d directories you can find the S and K links, like S20apache K10apache, that is basically what orders startup/shutdown of scripts.

There are some changes being made on this architecture but most of the linuxes are still using it.

share|improve this answer
I'm amazed most distros still use this system; better systems like rcorder have been around for a while. – Chris S Aug 30 '10 at 12:42
I kinda envy solaris svc, but could do without the xml stuff – coredump Aug 30 '10 at 12:45
This is spot on. Depending on your distro, however, you may have different ways of altering this value--so read up on the specific documentation for your distro. – Andrew M. Aug 30 '10 at 12:53
Some distributions, such as Ubuntu, use Upstart ( Wikipedia ). – Dennis Williamson Aug 30 '10 at 14:03

Instead of doing it manually, like suggested in the other answers, you could also change the init script. Just add such a line to the header:

# chkconfig: 35 90 10

This will instruct chkconfig to add the service to the runlevels 3 and 5, with a start position of 90 and a kill position of 10.

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.