mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
34eede0296
This allows to run the daemon in environments that have upstream containerd installed. Signed-off-by: Tibor Vass <tibor@docker.com>
48 lines
993 B
Go
48 lines
993 B
Go
package supervisor // import "github.com/docker/docker/libcontainerd/supervisor"
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/docker/docker/pkg/system"
|
|
)
|
|
|
|
const (
|
|
grpcPipeName = `\\.\pipe\containerd-containerd`
|
|
debugPipeName = `\\.\pipe\containerd-debug`
|
|
)
|
|
|
|
func (r *remote) setDefaults() {
|
|
if r.GRPC.Address == "" {
|
|
r.GRPC.Address = grpcPipeName
|
|
}
|
|
if r.Debug.Address == "" {
|
|
r.Debug.Address = debugPipeName
|
|
}
|
|
}
|
|
|
|
func (r *remote) stopDaemon() {
|
|
p, err := os.FindProcess(r.daemonPid)
|
|
if err != nil {
|
|
r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
|
|
return
|
|
}
|
|
|
|
if err = p.Kill(); err != nil {
|
|
r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("could not kill daemon process")
|
|
return
|
|
}
|
|
|
|
_, err = p.Wait()
|
|
if err != nil {
|
|
r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
|
|
return
|
|
}
|
|
}
|
|
|
|
func (r *remote) killDaemon() {
|
|
system.KillProcess(r.daemonPid)
|
|
}
|
|
|
|
func (r *remote) platformCleanup() {
|
|
// Nothing to do
|
|
}
|