When you run `update-rc.d myscript default` - what is called on startup/shutdown?
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.
Related videos on Youtube
David Parks
Updated on September 18, 2022Comments
-
David Parks over 1 year
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?