Set state running before dumping to disk

Fixes #4766
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Conflicts:
	daemon/container.go

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: vieux)
Add a conditional to contrib/init/sysvinit-debian/docker for Dash vs Bash support

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)

Docker-DCO-1.1-Signed-off-by: Tianon Gravi <admwiggin@gmail.com> (github: vieux)
Always mark as stopped for non running containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
Copy values out of hostConfig
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
Bump version to v1.1.2

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Merge pull request #7172 from vieux/bump_v1.1.2

Bump v1.1.2
Update nodejs_web_app.md

The image centos:centos6.4 doesn't exist. Instead you have to choose between the official centos6 or centos7. Both images does not work together with de yum npm install. When choosing an centos6.5 from another distributor (tutum) it works.
integcli: add some more docker utils

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
integcli: use dockerCmdInDir in build tests

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Apply @jamtur01's copy edit's to certificates.md

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: timthelion)
Update nodejs_web_app.md

Updated to documentation to use the centos6 image instead of the unofficial tutum image of centos6.4
Print about "copy volume content" test passing

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Added "Github Submodules" section to Automated Builds doc.

Signed-off-by: Hollie Teal <hollie.teal@docker.com>
Add contrib/nuke-graph-directory.sh script to clean out old /var/lib/docker directories much more easily

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Made requested changes (capitalization)
Add maintainers to daemon/ and graph/

Signed-off-by: Solomon Hykes <solomon@docker.com>
Container name lookups to prefer IDs over names

Lookups of container names should prefer the ID over
names assigned to containers by users.

Signed-off-by: Eric Windisch <eric@windisch.us>
Subsystems can register cleanup handlers with Engine.OnShutdown

Signed-off-by: Solomon Hykes <solomon@docker.com>
Move signal handling code to pkg/signal.Trap

Signed-off-by: Solomon Hykes <solomon@docker.com>
Cleanup: refactor shutdown and signal handling facility

This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>