Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Tonis Tiigi authored on 2017/03/15 08:09:08... | ... |
@@ -4,7 +4,9 @@ import ( |
4 | 4 |
"crypto/tls" |
5 | 5 |
"fmt" |
6 | 6 |
"net" |
7 |
+ "os" |
|
7 | 8 |
|
9 |
+ "github.com/Sirupsen/logrus" |
|
8 | 10 |
"github.com/docker/go-connections/sockets" |
9 | 11 |
) |
10 | 12 |
|
... | ... |
@@ -20,7 +22,11 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) (ls []net.List |
20 | 20 |
case "unix": |
21 | 21 |
gid, err := lookupGID(socketGroup) |
22 | 22 |
if err != nil { |
23 |
- return nil, err |
|
23 |
+ if socketGroup != defaultSocketGroup { |
|
24 |
+ return nil, err |
|
25 |
+ } |
|
26 |
+ logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err) |
|
27 |
+ gid = os.Getgid() |
|
24 | 28 |
} |
25 | 29 |
l, err := sockets.NewUnixSocket(addr, gid) |
26 | 30 |
if err != nil { |
... | ... |
@@ -6,8 +6,10 @@ import ( |
6 | 6 |
"crypto/tls" |
7 | 7 |
"fmt" |
8 | 8 |
"net" |
9 |
+ "os" |
|
9 | 10 |
"strconv" |
10 | 11 |
|
12 |
+ "github.com/Sirupsen/logrus" |
|
11 | 13 |
"github.com/coreos/go-systemd/activation" |
12 | 14 |
"github.com/docker/go-connections/sockets" |
13 | 15 |
) |
... | ... |
@@ -33,7 +35,11 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene |
33 | 33 |
case "unix": |
34 | 34 |
gid, err := lookupGID(socketGroup) |
35 | 35 |
if err != nil { |
36 |
- return nil, err |
|
36 |
+ if socketGroup != defaultSocketGroup { |
|
37 |
+ return nil, err |
|
38 |
+ } |
|
39 |
+ logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err) |
|
40 |
+ gid = os.Getgid() |
|
37 | 41 |
} |
38 | 42 |
l, err := sockets.NewUnixSocket(addr, gid) |
39 | 43 |
if err != nil { |