dotcloud/docker — pull request #5980 by zinic (2014-05-21 22:08:22+00:00)
Title: Proposed Refactorings for Client/Daemon Init

This commit contains several refactorings designed to aid in simplifying [/docker/docker.go](https://github.com/dotcloud/docker/blob/master/docker/docker.go). By refactoring much of the logic in the main function into functions that can be executed as an engine.Job, code domain is better isolated and helps break potential dependency tangle.

The following changes are included:
* Addition of a [new method to the engine.Job struct](https://github.com/zinic/docker/blob/master/engine/job.go#L108-L110) to allow for sub-job scheduling without requiring visibility into the Job's Engine
* Relocation of daemon argument processing and startup to its own file [/daemon/initjob.go](https://github.com/zinic/docker/blob/master/daemon/initjob.go) as an engine.Job
* Removal of daemon init related code from [/docker/docker.go](https://github.com/zinic/docker/blob/master/docker/docker.go)
* Modification of argument processing in [/docker/docker.go](https://github.com/zinic/docker/blob/master/docker/docker.go) to allow for a stepped transition to engine.Job for legacy client code
* Addition of the new daemon init job to [/builtins/builtins.go](https://github.com/zinic/docker/blob/master/builtins/builtins.go)

Docker-DCO-1.1-Signed-off-by: John Hopper (github: zinic)