My runlevel 0 scripts in /etc/rc0.d, which should be executed when stopping are for example
- K05foo -> ...
- K10bar -> ...
- K80baz -> ...
- S10somemore -> ...
- S90halt -> ...
Is it correct, that the excution order is as listed above, that is
- First all Kills, in ascending priority order
- Then all Starts, in ascending priority order
- All this, independently of the runlevel to which we switch (S,0-6)
- All scripts always get called (ie. there is no additional checks which would prevent a script to be called, for example whether in the previous runlevel that script was in fact started)
I'm confused because on my embedded system some of the scripts don't seem to get executed, and that page says
S20 link is started before a S91 and and K91 is kill before K20.
which contradicts my text above.
Answering my own question, for the sake of completness:
I'm using busybox on an OpenEmbedded system. The rc script in
/etc/init.d/rc
has the following behavior:Additionally, what bit me was that
shutdown now
actually switches to runlevel 1 and not runlevel 0. You have to usehalt
orpoweroff
for runlevel 0. So my scripts in rc0.d where not really executed, only the ones which happened to also be in rc1.d.It depends on the init daemon you are using.
For SysVInit you can assume something like the following to happen when you change the runlevel to 0:
I can't see a contradiction of the sentence you cited to the things you said above.