Chown grpc socket based on config
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
e1731d2e5e
commit
fc45d9c119
2 changed files with 5 additions and 0 deletions
|
@ -58,6 +58,8 @@ func (c *config) decodePlugin(name string, v interface{}) error {
|
||||||
|
|
||||||
type grpcConfig struct {
|
type grpcConfig struct {
|
||||||
Socket string `toml:"socket"`
|
Socket string `toml:"socket"`
|
||||||
|
Uid int `toml:"uid"`
|
||||||
|
Gid int `toml:"gid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type debug struct {
|
type debug struct {
|
||||||
|
|
|
@ -330,6 +330,9 @@ func serveGRPC(server *grpc.Server) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := os.Chown(path, conf.GRPC.Uid, conf.GRPC.Gid); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
go func() {
|
go func() {
|
||||||
defer l.Close()
|
defer l.Close()
|
||||||
if err := server.Serve(l); err != nil {
|
if err := server.Serve(l); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue