File: remote_daemon_windows.go

package info (click to toggle)
docker.io 28.5.2%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 68,176 kB
  • sloc: sh: 5,867; makefile: 863; ansic: 184; python: 162; asm: 159
file content (48 lines) | stat: -rw-r--r-- 954 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package supervisor

import (
	"os"

	"github.com/docker/docker/pkg/process"
)

const (
	binaryName    = "containerd.exe"
	grpcPipeName  = `\\.\pipe\docker-containerd`
	debugPipeName = `\\.\pipe\docker-containerd-debug`
)

func defaultGRPCAddress(stateDir string) string {
	return grpcPipeName
}

func defaultDebugAddress(stateDir string) string {
	return debugPipeName
}

func (r *remote) stopDaemon() {
	p, err := os.FindProcess(r.daemonPid)
	if err != nil {
		r.logger.WithField("pid", r.daemonPid).Warn("could not find daemon process")
		return
	}

	if err = p.Kill(); err != nil {
		r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("could not kill daemon process")
		return
	}

	_, err = p.Wait()
	if err != nil {
		r.logger.WithError(err).WithField("pid", r.daemonPid).Warn("wait for daemon process")
		return
	}
}

func (r *remote) killDaemon() {
	_ = process.Kill(r.daemonPid)
}

func (r *remote) platformCleanup() {
	// Nothing to do
}