Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

The scripts linked at /etc/rc0...6.d/ have numbers at the begining right after the letter S/K, so the question is what is order of execution? From the lower to higher or higher to lower? I also would like to know if there is any rules on these number, can I create a script with number 1, 2, ..., 97, 98, or only some specific numbers are allowed?

I'd like to run a script after the system boot and before the system shutdown, but as those scripts needs internet connection to perform its tasks at which runlevel folder should I place it?

share|improve this question
up vote 4 down vote accepted

They're run low to high. Here's a good TLDP page on runlevels in general.

You can use whatever number you like. They're sorted by number to give some systems prioroty over others. These are loaded sequentially. It's not event-driven like Upstart.

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.