2016-03-25 19:38:00 -04:00
|
|
|
// +build solaris
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/docker/docker/libcontainerd"
|
2017-05-23 10:22:32 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2016-03-25 19:38:00 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
const defaultDaemonConfigFile = ""
|
|
|
|
|
|
|
|
// setDefaultUmask sets the umask to 0022 to avoid problems
|
|
|
|
// caused by custom umask
|
|
|
|
func setDefaultUmask() error {
|
|
|
|
desiredUmask := 0022
|
2017-05-23 10:22:32 -04:00
|
|
|
unix.Umask(desiredUmask)
|
|
|
|
if umask := unix.Umask(desiredUmask); umask != desiredUmask {
|
2016-03-25 19:38:00 -04:00
|
|
|
return fmt.Errorf("failed to set umask: expected %#o, got %#o", desiredUmask, umask)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-11-04 15:42:21 -04:00
|
|
|
func getDaemonConfDir(_ string) string {
|
2016-03-25 19:38:00 -04:00
|
|
|
return "/etc/docker"
|
|
|
|
}
|
|
|
|
|
|
|
|
// setupConfigReloadTrap configures the USR2 signal to reload the configuration.
|
|
|
|
func (cli *DaemonCli) setupConfigReloadTrap() {
|
|
|
|
}
|
|
|
|
|
2017-02-01 13:52:16 -05:00
|
|
|
// preNotifySystem sends a message to the host when the API is active, but before the daemon is
|
|
|
|
func preNotifySystem() {
|
|
|
|
}
|
|
|
|
|
2016-03-25 19:38:00 -04:00
|
|
|
// notifySystem sends a message to the host when the server is ready to be used
|
|
|
|
func notifySystem() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption {
|
|
|
|
opts := []libcontainerd.RemoteOption{}
|
2016-06-07 03:45:21 -04:00
|
|
|
if cli.Config.ContainerdAddr != "" {
|
|
|
|
opts = append(opts, libcontainerd.WithRemoteAddr(cli.Config.ContainerdAddr))
|
|
|
|
} else {
|
|
|
|
opts = append(opts, libcontainerd.WithStartDaemon(true))
|
|
|
|
}
|
2016-03-25 19:38:00 -04:00
|
|
|
return opts
|
|
|
|
}
|
|
|
|
|
|
|
|
// getLibcontainerdRoot gets the root directory for libcontainerd/containerd to
|
|
|
|
// store their state.
|
|
|
|
func (cli *DaemonCli) getLibcontainerdRoot() string {
|
|
|
|
return filepath.Join(cli.Config.ExecRoot, "libcontainerd")
|
|
|
|
}
|
|
|
|
|
2016-08-19 16:06:28 -04:00
|
|
|
// getSwarmRunRoot gets the root directory for swarm to store runtime state
|
|
|
|
// For example, the control socket
|
|
|
|
func (cli *DaemonCli) getSwarmRunRoot() string {
|
|
|
|
return filepath.Join(cli.Config.ExecRoot, "swarm")
|
|
|
|
}
|
|
|
|
|
2016-03-25 19:38:00 -04:00
|
|
|
func allocateDaemonPort(addr string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// notifyShutdown is called after the daemon shuts down but before the process exits.
|
|
|
|
func notifyShutdown(err error) {
|
|
|
|
}
|
|
|
|
|
|
|
|
func wrapListeners(proto string, ls []net.Listener) []net.Listener {
|
|
|
|
return ls
|
|
|
|
}
|