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

What gets called on startup/shutdown when you run update-rc.d myscript default?

Docs seem fuzzy, I want concrete. I am guessing that this happens:

At startup (specifically at entry to runlevel 2, multiuser), this command is executed:

/etc/init.d/myscript start

And at shutdown/reboot the same script is called as:

/etc/init.d/myscript stop

Is that all that is really happening here?

share|improve this question
up vote 4 down vote accepted

That is correct.

Taken from man update-rc.d:

If defaults is used then update-rc.d will make links to start the ser‐ vice in runlevels 2345 and to stop the service in runlevels 016. By default all the links will have sequence number 20, but this should be overridden if there are dependencies. For example if daemon B depends on A, then A must be started before B and B must be killed before A. You accomplish this by supplying two NN arguments. In general, core daemons should start early and be killed late, whilst applications can start late and be killed early.

More information here, look for the "Installing custom init-scripts" section.

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.