{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/13304","labels_url":"https://api.github.com/repos/docker/docker/issues/13304/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/13304/comments","events_url":"https://api.github.com/repos/docker/docker/issues/13304/events","html_url":"https://github.com/docker/docker/pull/13304","id":77667184,"number":13304,"title":"Fix restart docker daemon with paused containers","user":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars.githubusercontent.com/u/8232360?v=3","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/1-needs-design-review","name":"status/1-needs-design-review","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-05-18T13:59:25Z","updated_at":"2015-06-09T14:28:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/13304","html_url":"https://github.com/docker/docker/pull/13304","diff_url":"https://github.com/docker/docker/pull/13304.diff","patch_url":"https://github.com/docker/docker/pull/13304.patch"},"body":"Signed-off-by: Lei Jitang <leijitang@huawei.com>\r\n\r\nI think this is better fix than #12802 .\r\nRestarting docker daemon with paused containers really caused a big problem,\r\nthe paused containers will can't be start on docker daemon restart, and if the \r\npaused containers happened to have a restart policy `restart=always`, the daemon will hang.\r\nSo, I think we should prevent these from happening. \r\nThis fix is to send 15 to container and then unpause it, this is just what\r\nthe kernel designed for. If we want terminate a process in freezer cgroup,\r\nwe should send terminate signal to this process and then unfreeze it, and then this process will\r\nterminate. In this way, it will not case unsafe problem.\r\nping @LK4D4 @aluzzardi @tiborvass @jfrazelle @cpuguy83 \r\ncc @lexandro \r\n\r\nBut if we just want to keep it work like it does today, pls feel free to close  :)"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/110378750","html_url":"https://github.com/docker/docker/pull/13304#issuecomment-110378750","issue_url":"https://api.github.com/repos/docker/docker/issues/13304","id":110378750,"user":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars.githubusercontent.com/u/8232360?v=3","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T14:28:32Z","updated_at":"2015-06-09T14:28:32Z","body":"@duglin  I understand you point , I think this is a common problem not only for docker, other software have the same problem, abnormal shutdown of software will with some information missing and hard to recover or cleanup on next startup.\r\nI think to do this logic upon daemon startup need some journal file, with a journal file we can know if the daemon is shutdown normally and we can do some recover base on the journal file.\r\nThis PR is to make normal shutdown of daemon cleanup what has created. "}}