The official Ubuntu document reads as follows::
What order are initscripts Started and stopped in?
If a service has not been converted to upstart, this has not changed; the symlinks are named Snnname or Knnname, Where NN is a number from 00 to 99. The K scripts are run first in numerical order, Followed by the S scripts in numerical order.
However, services which have been converted to upstart will define their start criteria in the file, like this:
start on runlevel [2345] stop on runlevel [!2345]
This Means the service will be Started when the system Reaches runlevel 2, 3, 4, or 5. It should be noted that it will be Started in Parallel with Every other service that Starts on those runlevels, and Anything Else still Starting. The [!2345] in the stop on Means it will be stopped Whenever a runlevel that is not 2, 3, 4, or 5 is reached.
Then I conclude that there is an upstart service that must be calling your /etc/init.d/rc.local
parallel to other init scripts.
I suggest creating an old-fashioned init script (sysvinit
) in /etc/rcX.d/S99script
, where X is your default runlevel (check yours on /etc/init/rc-sysinit.conf
. This should ensure that it will run last.
I’ll try and get back. Thank you!
– Clau Santos