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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.