When you run `update-rc.d myscript default` - what is called on startup/shutdown?

Solution 1:

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.