Set socket mode after creation.
This commit is contained in:
parent
341329b76d
commit
f2f46120f6
1 changed files with 6 additions and 1 deletions
|
@ -175,7 +175,7 @@ func (s *Server) Run() error {
|
|||
listenStr += fmt.Sprintf(" %s[https]", s.config.ListenHTTPS)
|
||||
}
|
||||
if s.config.ListenUnix != "" {
|
||||
listenStr += fmt.Sprintf(" %s[unix]", s.config.ListenUnix)
|
||||
listenStr += fmt.Sprintf(" %s[unix/%04o]", s.config.ListenUnix, s.config.ListenUnixMode)
|
||||
}
|
||||
if s.config.SMTPServerListen != "" {
|
||||
listenStr += fmt.Sprintf(" %s[smtp]", s.config.SMTPServerListen)
|
||||
|
@ -208,6 +208,11 @@ func (s *Server) Run() error {
|
|||
errChan <- err
|
||||
return
|
||||
}
|
||||
if err := os.Chmod(s.config.ListenUnix, s.config.ListenUnixMode); err != nil {
|
||||
s.unixListener.Close()
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
s.mu.Unlock()
|
||||
httpServer := &http.Server{Handler: mux}
|
||||
errChan <- httpServer.Serve(s.unixListener)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue