Set local unix socket permissions to rw (#263)

This commit is contained in:
Mikhail Bragin 2022-03-13 15:16:35 +01:00 committed by GitHub
parent d7b69b91b9
commit b2f4322a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,14 @@ func (p *program) Start(svc service.Service) error {
}
defer listen.Close()
if split[0] == "unix" {
err = os.Chmod(split[1], 0666)
if err != nil {
log.Errorf("failed setting daemon permissions: %v", split[1])
return
}
}
serverInstance := server.New(p.ctx, managementURL, configPath, stopCh, cleanupCh)
if err := serverInstance.Start(); err != nil {
log.Fatalf("failed start daemon: %v", err)

View File

@ -64,6 +64,7 @@ func (s *Server) Start() error {
log.Warnf("no config file, skip connection stage: %v", err)
return nil
}
s.config = config
go func() {
if err := internal.RunClient(ctx, config, s.stopCh, s.cleanupCh); err != nil {