1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/docker
Solomon Hykes c9f3fd3fc7 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>
2014-08-06 17:56:11 +00:00
..
client.go Add a "daemon" build tag and toggle it with the already-existing "DOCKER_CLIENTONLY" build variable 2014-08-04 15:05:12 -06:00
daemon.go Cleanup: refactor shutdown and signal handling facility 2014-08-06 17:56:11 +00:00
docker.go Add a "daemon" build tag and toggle it with the already-existing "DOCKER_CLIENTONLY" build variable 2014-08-04 15:05:12 -06:00
flags.go Rename DOCKER_CONFIG envvar to DOCKER_CERT_PATH 2014-08-04 17:36:53 -07:00
README.md Add README.md file for the docker directory 2014-05-20 09:04:46 +00:00

docker.go contains Docker's main function.

This file provides first line CLI argument parsing and environment variable setting.