github.com/go/docker@v1.12.0-rc2/cmd/dockerd/daemon_solaris.go (about)

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