-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[master] [TAR-303] Start docker.service after containerd.service #290
[master] [TAR-303] Start docker.service after containerd.service #290
Conversation
Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
Going to merge this in so we can get this into nightlies, will revert if this doesn't solve our issue. |
I wonder why we don't set the ctx, cancel := context.WithCancel(context.Background())
if cli.Config.ContainerdAddr == "" && runtime.GOOS != "windows" {
if !systemContainerdRunning() {
opts, err := cli.getContainerdDaemonOpts()
if err != nil {
cancel()
return errors.Wrap(err, "failed to generate containerd options")
}
r, err := supervisor.Start(ctx, filepath.Join(cli.Config.Root, "containerd"), filepath.Join(cli.Config.ExecRoot, "containerd"), opts...)
if err != nil {
cancel()
return errors.Wrap(err, "failed to start containerd")
}
cli.Config.ContainerdAddr = r.Address()
// Try to wait for containerd to shutdown
defer r.WaitTimeout(10 * time.Second)
} else {
cli.Config.ContainerdAddr = containerddefaults.DefaultAddress
}
} |
func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
} That shouldn't really matter since const (
// DefaultRootDir is the default location used by containerd to store
// persistent data
DefaultRootDir = "/var/lib/containerd"
// DefaultStateDir is the default location used by containerd to store
// transient data
DefaultStateDir = "/run/containerd"
// DefaultAddress is the default unix socket address
DefaultAddress = "/run/containerd/containerd.sock"
// DefaultDebugAddress is the default unix socket address for pprof data
DefaultDebugAddress = "/run/containerd/debug.sock"
// DefaultFIFODir is the default location used by client-side cio library
// to store FIFOs.
DefaultFIFODir = "/run/containerd/fifo"
) https://github.com/containerd/containerd/blob/master/defaults/defaults_unix.go#L29, so there's no real need to set the default to |
There is a need; look at the second line; if cli.Config.ContainerdAddr == "" && runtime.GOOS != "windows" { That part of the code is only executed if |
The `docker-ce` 18.09.1 packaging missed an `After` dependency on containerd in the systemd service. Upstream PR: docker/docker-ce-packaging#290
The `docker-ce` 18.09.1 packaging missed an `After` dependency on containerd in the systemd service. Upstream PR: docker/docker-ce-packaging#290
Reproduced the error seen here docker/for-linux#556 on a Centos 7 machine. Placing an
After=containerd.service
into thedocker.service
file fixed the issue and new docker containers that were ran would restart properly.Signed-off-by: corbin-coleman corbin.coleman@docker.com