remote_daemon_windows.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // +build remote_daemon
  2. package 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.Debug.Level == "" {
  18. r.Debug.Level = "info"
  19. }
  20. if r.snapshotter == "" {
  21. r.snapshotter = "naive" // TODO(mlaventure): switch to "windows" once implemented
  22. }
  23. }
  24. func (r *remote) stopDaemon() {
  25. p, err := os.FindProcess(r.daemonPid)
  26. if err != nil {
  27. r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
  28. return
  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. _, err = p.Wait()
  35. if err != nil {
  36. r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
  37. return
  38. }
  39. }
  40. func (r *remote) platformCleanup() {
  41. // Nothing to do
  42. }