diff --git a/pkg/listeners/group_unix.go b/pkg/listeners/group_unix.go index 183a0eb9d3..c487079355 100644 --- a/pkg/listeners/group_unix.go +++ b/pkg/listeners/group_unix.go @@ -10,6 +10,8 @@ import ( "github.com/pkg/errors" ) +const defaultSocketGroup = "docker" + func lookupGID(name string) (int, error) { groupFile, err := user.GetGroupPath() if err != nil { diff --git a/pkg/listeners/listeners_solaris.go b/pkg/listeners/listeners_solaris.go index 58e43a0ac2..0482f3d732 100644 --- a/pkg/listeners/listeners_solaris.go +++ b/pkg/listeners/listeners_solaris.go @@ -4,7 +4,9 @@ import ( "crypto/tls" "fmt" "net" + "os" + "github.com/Sirupsen/logrus" "github.com/docker/go-connections/sockets" ) @@ -20,7 +22,11 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) (ls []net.List case "unix": gid, err := lookupGID(socketGroup) if err != nil { - return nil, err + if socketGroup != defaultSocketGroup { + return nil, err + } + logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err) + gid = os.Getgid() } l, err := sockets.NewUnixSocket(addr, gid) if err != nil { diff --git a/pkg/listeners/listeners_unix.go b/pkg/listeners/listeners_unix.go index 3e7bfcb1ec..23ead610bf 100644 --- a/pkg/listeners/listeners_unix.go +++ b/pkg/listeners/listeners_unix.go @@ -6,8 +6,10 @@ import ( "crypto/tls" "fmt" "net" + "os" "strconv" + "github.com/Sirupsen/logrus" "github.com/coreos/go-systemd/activation" "github.com/docker/go-connections/sockets" ) @@ -33,7 +35,11 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene case "unix": gid, err := lookupGID(socketGroup) if err != nil { - return nil, err + if socketGroup != defaultSocketGroup { + return nil, err + } + logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err) + gid = os.Getgid() } l, err := sockets.NewUnixSocket(addr, gid) if err != nil {