remote_daemon_windows.go 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package supervisor // import "github.com/docker/docker/libcontainerd/supervisor"
  2. import (
  3. "os"
  4. "github.com/docker/docker/pkg/system"
  5. )
  6. const (
  7. grpcPipeName = `\\.\pipe\containerd-containerd`
  8. debugPipeName = `\\.\pipe\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. }
  18. func (r *remote) stopDaemon() {
  19. p, err := os.FindProcess(r.daemonPid)
  20. if err != nil {
  21. r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
  22. return
  23. }
  24. if err = p.Kill(); err != nil {
  25. r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("could not kill daemon process")
  26. return
  27. }
  28. _, err = p.Wait()
  29. if err != nil {
  30. r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
  31. return
  32. }
  33. }
  34. func (r *remote) killDaemon() {
  35. system.KillProcess(r.daemonPid)
  36. }
  37. func (r *remote) platformCleanup() {
  38. // Nothing to do
  39. }