dotcloud/docker — pull request #378 by flavio (2013-04-10 10:35:33+00:00)
Title: docker daemon: create file containing PID

Ensure the docker daemon creates a file containing its PID under `/var/run/docker.pid`.

The daemon takes care of removing the pid file when it receives either `SIGTERM`, `SIGINT` or `SIGKILL`.

The daemon also refuses to start when the pidfile is found. An explanation message is shown to the user when this happens.

This change is required to make docker easier to manage by tools like `checkproc` which rely on this information.

A final note: I'm still a go newbie, please take that into consideration while reviewing the pull request :)