reboot worker

This is the final PR for the reboot functionallity. It add a Reboot worker that waits for the machines reboot flag to be changed, and reacts.

This branch depends on:

https://github.com/juju/juju/pull/707
https://github.com/juju/juju/pull/728
https://github.com/juju/juju/pull/744
It is a possibility, you are right. That is one reason I originally cleared the reboot flag before rebooting. That way you guarantee that the flag is clear at startup, and there is no need to save a file on disk letting you know you  need to do cleanup.

That approach however will create a potential risk of clearing the flag and failing to actually reboot, if say in the millisecond between clearing the flag and executing the reboot binary, someone kills jujud, or the process crashes.

One way to get around this is to make sure containers are started last in the init process. This however would be something I would not do, given the choice...