remote_daemon_windows.go 1.0 KB

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