The current docker init file does not specify containerd as dependency. When the docker service is started, it first starts containerd itself. You can check this by ``` rc-service docker stop rc-service containerd stop dockerd ``` -> output that indicates that both docker and containerd are started. Htop shows containerd as child process of dockerd. There exists a separate init script for containerd which is always there when docker is installed because app-containers/containerd (to which the file belongs) is pulled in as a dependency of docker. When starting the containerd service before docker, the already existing process is used. You can check this by ``` rc-service docker stop rc-service containerd start dockerd ``` -> output that indicates that only dockerd is started. Containerd is a separate process. The reason why I even noticed this is, that on some of my systems, the docker service randomly crashes on boot (when started with `/etc/init.d/docker start`) but I noticed that containerd is started. I guess the reason could be that openrc get's confused by the two processes and kills docker while keeping containerd. The issue seems fixed when specifying containerd as dependency in the init file (see attached patch file). #829561 could also be related to this. Note: This is not only a problem of v20.10.14. The init file wasn't changed since 2013. Reproducible: Always
Created attachment 776606 [details, diff] Docker init patch file
Docker maintains their own openrc scripts, so please file a pull request upstream at http://github.com/moby/moby and link it here. I will revbump with the patch if it is accepted upstream. Thanks, William
Thanks. Upstream pull request is here: https://github.com/moby/moby/pull/43604
I recommend removing the containerd service script from the upstream docker pull request; it isn't their responsibility to maintain it. The only thing they should maintain is the docker service script. It also doesn't buy me anything at this level to have a containerd service script in upstream docker since I wouldn't ever use it. Thanks, William
FYI the upstream pull request has been accepted a while ago.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef4dcc87b0492239a0f5270c235a87b07870adff commit ef4dcc87b0492239a0f5270c235a87b07870adff Author: William Hubbs <williamh@gentoo.org> AuthorDate: 2022-08-14 22:39:26 +0000 Commit: William Hubbs <williamh@gentoo.org> CommitDate: 2022-08-14 22:46:29 +0000 app-containers/docker: add 20.10.17 Closes: https://bugs.gentoo.org/842567 Closes: https://bugs.gentoo.org/854231 Signed-off-by: William Hubbs <williamh@gentoo.org> app-containers/docker/Manifest | 1 + app-containers/docker/docker-20.10.17.ebuild | 285 +++++++++++++++++++++ ...1-Openrc-Depend-on-containerd-init-script.patch | 28 ++ 3 files changed, 314 insertions(+)