Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 842567 - app-containers/docker-20.10.14: Depend on containerd in init file
Summary: app-containers/docker-20.10.14: Depend on containerd in init file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-04 09:14 UTC by Jan Breig
Modified: 2022-08-14 22:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Docker init patch file (docker-init.diff,354 bytes, patch)
2022-05-04 09:15 UTC, Jan Breig
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Breig 2022-05-04 09:14:42 UTC
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
Comment 1 Jan Breig 2022-05-04 09:15:03 UTC
Created attachment 776606 [details, diff]
Docker init patch file
Comment 2 William Hubbs gentoo-dev 2022-05-15 21:25:15 UTC
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
Comment 3 Jan Breig 2022-05-16 13:51:40 UTC
Thanks.  
Upstream pull request is here: https://github.com/moby/moby/pull/43604
Comment 4 William Hubbs gentoo-dev 2022-05-17 14:42:07 UTC
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
Comment 5 Jan Breig 2022-06-20 11:06:59 UTC
FYI the upstream pull request has been accepted a while ago.
Comment 6 Larry the Git Cow gentoo-dev 2022-08-14 22:46:36 UTC
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(+)