After a spot of digging around I have established - I may be wrong since my knowledge of these issues is rather sketchy - that the scripts in /etc/init.d are run in the order determined by the symlinks in /etc/rcN.d.
It is not quite clear to me why I have, on Ubuntu 14.10, a whole sequence of rcN.d folders with N running from 0 to 5. runlevel indicates that the current runlevel is N 2. In /etc/rc2.d I have the files
s01rsyslog s02memcached ... so3grub-common
I assume this indicates that the s01 scripts will run prior to the s02 scripts etc.
Now here is what I need to do - run my own script in init.d AFTER everything else. Before I try it out I would like to just establish if this would be the right hting to do
- Create the script
- chmod +x it
- create a symlink to it in /etc/rc2.d
- name that symlink with s04...
I'd be most grateful to anyone who might be able to confirm that this is the right way to do things