github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/libcontainerd/supervisor/remote_daemon_windows.go (about)

     1  package supervisor // import "github.com/docker/docker/libcontainerd/supervisor"
     2  
     3  import (
     4  	"os"
     5  
     6  	"github.com/docker/docker/pkg/system"
     7  )
     8  
     9  const (
    10  	grpcPipeName  = `\\.\pipe\containerd-containerd`
    11  	debugPipeName = `\\.\pipe\containerd-debug`
    12  )
    13  
    14  func (r *remote) setDefaults() {
    15  	if r.GRPC.Address == "" {
    16  		r.GRPC.Address = grpcPipeName
    17  	}
    18  	if r.Debug.Address == "" {
    19  		r.Debug.Address = debugPipeName
    20  	}
    21  }
    22  
    23  func (r *remote) stopDaemon() {
    24  	p, err := os.FindProcess(r.daemonPid)
    25  	if err != nil {
    26  		r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
    27  		return
    28  	}
    29  
    30  	if err = p.Kill(); err != nil {
    31  		r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("could not kill daemon process")
    32  		return
    33  	}
    34  
    35  	_, err = p.Wait()
    36  	if err != nil {
    37  		r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
    38  		return
    39  	}
    40  }
    41  
    42  func (r *remote) killDaemon() {
    43  	system.KillProcess(r.daemonPid)
    44  }
    45  
    46  func (r *remote) platformCleanup() {
    47  	// Nothing to do
    48  }