github.com/reds/docker@v1.11.2-rc1/docker/daemon_windows.go (about) 1 // +build daemon 2 3 package main 4 5 import ( 6 "fmt" 7 "os" 8 "syscall" 9 10 "github.com/Sirupsen/logrus" 11 apiserver "github.com/docker/docker/api/server" 12 "github.com/docker/docker/daemon" 13 "github.com/docker/docker/libcontainerd" 14 "github.com/docker/docker/pkg/mflag" 15 "github.com/docker/docker/pkg/system" 16 ) 17 18 var defaultDaemonConfigFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker" + string(os.PathSeparator) + "config" + string(os.PathSeparator) + "daemon.json" 19 20 func setPlatformServerConfig(serverConfig *apiserver.Config, daemonCfg *daemon.Config) *apiserver.Config { 21 return serverConfig 22 } 23 24 // currentUserIsOwner checks whether the current user is the owner of the given 25 // file. 26 func currentUserIsOwner(f string) bool { 27 return false 28 } 29 30 // setDefaultUmask doesn't do anything on windows 31 func setDefaultUmask() error { 32 return nil 33 } 34 35 func getDaemonConfDir() string { 36 return os.Getenv("PROGRAMDATA") + `\docker\config` 37 } 38 39 // notifySystem sends a message to the host when the server is ready to be used 40 func notifySystem() { 41 } 42 43 // setupConfigReloadTrap configures a Win32 event to reload the configuration. 44 func setupConfigReloadTrap(configFile string, flags *mflag.FlagSet, reload func(*daemon.Config)) { 45 go func() { 46 sa := syscall.SecurityAttributes{ 47 Length: 0, 48 } 49 ev := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid()) 50 if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 { 51 logrus.Debugf("Config reload - waiting signal at %s", ev) 52 for { 53 syscall.WaitForSingleObject(h, syscall.INFINITE) 54 if err := daemon.ReloadConfiguration(configFile, flags, reload); err != nil { 55 logrus.Error(err) 56 } 57 } 58 } 59 }() 60 } 61 62 func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption { 63 return nil 64 }