daemon_solaris.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // +build solaris
  2. package main
  3. import (
  4. "fmt"
  5. "net"
  6. "path/filepath"
  7. "github.com/docker/docker/libcontainerd"
  8. "golang.org/x/sys/unix"
  9. )
  10. const defaultDaemonConfigFile = ""
  11. // setDefaultUmask sets the umask to 0022 to avoid problems
  12. // caused by custom umask
  13. func setDefaultUmask() error {
  14. desiredUmask := 0022
  15. unix.Umask(desiredUmask)
  16. if umask := unix.Umask(desiredUmask); umask != desiredUmask {
  17. return fmt.Errorf("failed to set umask: expected %#o, got %#o", desiredUmask, umask)
  18. }
  19. return nil
  20. }
  21. func getDaemonConfDir(_ string) string {
  22. return "/etc/docker"
  23. }
  24. // setupConfigReloadTrap configures the USR2 signal to reload the configuration.
  25. func (cli *DaemonCli) setupConfigReloadTrap() {
  26. }
  27. // preNotifySystem sends a message to the host when the API is active, but before the daemon is
  28. func preNotifySystem() {
  29. }
  30. // notifySystem sends a message to the host when the server is ready to be used
  31. func notifySystem() {
  32. }
  33. func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption {
  34. opts := []libcontainerd.RemoteOption{}
  35. if cli.Config.ContainerdAddr != "" {
  36. opts = append(opts, libcontainerd.WithRemoteAddr(cli.Config.ContainerdAddr))
  37. } else {
  38. opts = append(opts, libcontainerd.WithStartDaemon(true))
  39. }
  40. return opts
  41. }
  42. // getLibcontainerdRoot gets the root directory for libcontainerd/containerd to
  43. // store their state.
  44. func (cli *DaemonCli) getLibcontainerdRoot() string {
  45. return filepath.Join(cli.Config.ExecRoot, "libcontainerd")
  46. }
  47. // getSwarmRunRoot gets the root directory for swarm to store runtime state
  48. // For example, the control socket
  49. func (cli *DaemonCli) getSwarmRunRoot() string {
  50. return filepath.Join(cli.Config.ExecRoot, "swarm")
  51. }
  52. func allocateDaemonPort(addr string) error {
  53. return nil
  54. }
  55. // notifyShutdown is called after the daemon shuts down but before the process exits.
  56. func notifyShutdown(err error) {
  57. }
  58. func wrapListeners(proto string, ls []net.Listener) []net.Listener {
  59. return ls
  60. }