daemon_solaris.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // +build solaris
  2. package main
  3. import (
  4. "fmt"
  5. "net"
  6. "os"
  7. "path/filepath"
  8. "syscall"
  9. "github.com/docker/docker/libcontainerd"
  10. "github.com/docker/docker/pkg/system"
  11. )
  12. const defaultDaemonConfigFile = ""
  13. // currentUserIsOwner checks whether the current user is the owner of the given
  14. // file.
  15. func currentUserIsOwner(f string) bool {
  16. if fileInfo, err := system.Stat(f); err == nil && fileInfo != nil {
  17. if int(fileInfo.UID()) == os.Getuid() {
  18. return true
  19. }
  20. }
  21. return false
  22. }
  23. // setDefaultUmask sets the umask to 0022 to avoid problems
  24. // caused by custom umask
  25. func setDefaultUmask() error {
  26. desiredUmask := 0022
  27. syscall.Umask(desiredUmask)
  28. if umask := syscall.Umask(desiredUmask); umask != desiredUmask {
  29. return fmt.Errorf("failed to set umask: expected %#o, got %#o", desiredUmask, umask)
  30. }
  31. return nil
  32. }
  33. func getDaemonConfDir() string {
  34. return "/etc/docker"
  35. }
  36. // setupConfigReloadTrap configures the USR2 signal to reload the configuration.
  37. func (cli *DaemonCli) setupConfigReloadTrap() {
  38. }
  39. // notifySystem sends a message to the host when the server is ready to be used
  40. func notifySystem() {
  41. }
  42. func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption {
  43. opts := []libcontainerd.RemoteOption{}
  44. return opts
  45. }
  46. // getLibcontainerdRoot gets the root directory for libcontainerd/containerd to
  47. // store their state.
  48. func (cli *DaemonCli) getLibcontainerdRoot() string {
  49. return filepath.Join(cli.Config.ExecRoot, "libcontainerd")
  50. }
  51. func allocateDaemonPort(addr string) error {
  52. return nil
  53. }
  54. // notifyShutdown is called after the daemon shuts down but before the process exits.
  55. func notifyShutdown(err error) {
  56. }
  57. func wrapListeners(proto string, ls []net.Listener) []net.Listener {
  58. return ls
  59. }