Code review comment for lp:~smoser/ubuntu/precise/sysvinit/rc.local.d

Clint Byrum (clint-fewbar) wrote :

Scott this is pretty cool! However, I actually think rc.local *should* be moved to be run by an upstart job rather than rc2.d links. It should be:

# /etc/init/rc-local.conf
start on stopped rc RUNLEVEL=[2345]
task

description "/etc/rc.local"

exec /etc/rc.local start

This would put it pretty much as late as possible in the boot, though it still does not address the fact that some things may be starting in parallel still if they have something like:

start on runlevel [2345]

But that is an issue with the current one as well.

Anyway, that should become part of upstart, and then the update-rc.d removed from initscripts. Then your job gets simpler:

# /etc/init/rc-local-d.conf
start on stopped rc-local
task

description "local boot scripts (/etc/rc.local.d)"

pre-start script
  [ -d /etc/rc.local.d ] || stop
  command -v run-parts >/dev/null 2>&1 || stop
end script

exec run-parts /etc/rc.local.d

I like the idea of having two separate jobs because the user will get messages in noquiet boot (default for servers) that show

* Starting /etc/rc.local
* Stopping /etc/rc.local
* Starting local boot scripts (/etc/rc.local.d)
* Stopping local boot scripts (/etc/rc.local.d)

Would you be willing to move it over to upstart?

review: Needs Information

« Back to merge proposal