github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/cmd/dockerd/daemon_windows.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "net" 6 "os" 7 "path/filepath" 8 "syscall" 9 10 "github.com/Sirupsen/logrus" 11 "github.com/docker/docker/libcontainerd" 12 "github.com/docker/docker/pkg/system" 13 ) 14 15 var defaultDaemonConfigFile = "" 16 17 // currentUserIsOwner checks whether the current user is the owner of the given 18 // file. 19 func currentUserIsOwner(f string) bool { 20 return false 21 } 22 23 // setDefaultUmask doesn't do anything on windows 24 func setDefaultUmask() error { 25 return nil 26 } 27 28 func getDaemonConfDir(root string) string { 29 return filepath.Join(root, `\config`) 30 } 31 32 // notifySystem sends a message to the host when the server is ready to be used 33 func notifySystem() { 34 if service != nil { 35 err := service.started() 36 if err != nil { 37 logrus.Fatal(err) 38 } 39 } 40 } 41 42 // notifyShutdown is called after the daemon shuts down but before the process exits. 43 func notifyShutdown(err error) { 44 if service != nil { 45 if err != nil { 46 logrus.Fatal(err) 47 } 48 service.stopped(err) 49 } 50 } 51 52 // setupConfigReloadTrap configures a Win32 event to reload the configuration. 53 func (cli *DaemonCli) setupConfigReloadTrap() { 54 go func() { 55 sa := syscall.SecurityAttributes{ 56 Length: 0, 57 } 58 ev := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid()) 59 if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 { 60 logrus.Debugf("Config reload - waiting signal at %s", ev) 61 for { 62 syscall.WaitForSingleObject(h, syscall.INFINITE) 63 cli.reloadConfig() 64 } 65 } 66 }() 67 } 68 69 func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption { 70 return nil 71 } 72 73 // getLibcontainerdRoot gets the root directory for libcontainerd to store its 74 // state. The Windows libcontainerd implementation does not need to write a spec 75 // or state to disk, so this is a no-op. 76 func (cli *DaemonCli) getLibcontainerdRoot() string { 77 return "" 78 } 79 80 // getSwarmRunRoot gets the root directory for swarm to store runtime state 81 // For example, the control socket 82 func (cli *DaemonCli) getSwarmRunRoot() string { 83 return "" 84 } 85 86 func allocateDaemonPort(addr string) error { 87 return nil 88 } 89 90 func wrapListeners(proto string, ls []net.Listener) []net.Listener { 91 return ls 92 }