remote_daemon_windows.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // +build remote_daemon
  2. package libcontainerd // import "github.com/docker/docker/libcontainerd"
  3. import (
  4. "os"
  5. )
  6. const (
  7. grpcPipeName = `\\.\pipe\docker-containerd-containerd`
  8. debugPipeName = `\\.\pipe\docker-containerd-debug`
  9. )
  10. func (r *remote) setDefaults() {
  11. if r.GRPC.Address == "" {
  12. r.GRPC.Address = grpcPipeName
  13. }
  14. if r.Debug.Address == "" {
  15. r.Debug.Address = debugPipeName
  16. }
  17. if r.snapshotter == "" {
  18. r.snapshotter = "naive" // TODO(mlaventure): switch to "windows" once implemented
  19. }
  20. }
  21. func (r *remote) stopDaemon() {
  22. p, err := os.FindProcess(r.daemonPid)
  23. if err != nil {
  24. r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
  25. return
  26. }
  27. if err = p.Kill(); err != nil {
  28. r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("could not kill daemon process")
  29. return
  30. }
  31. _, err = p.Wait()
  32. if err != nil {
  33. r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
  34. return
  35. }
  36. }
  37. func (r *remote) platformCleanup() {
  38. // Nothing to do
  39. }