aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dispatch/main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/dispatch/main.go b/cmd/dispatch/main.go
index 032797d..a940584 100644
--- a/cmd/dispatch/main.go
+++ b/cmd/dispatch/main.go
@@ -9,6 +9,7 @@ import (
"context"
"net"
"net/http"
+ "os"
"github.com/gorilla/mux"
"go.eth.moe/dispatch/config"
@@ -45,6 +46,10 @@ func main() {
log.WithError(err).Fatal("could not parse config")
}
+ if listen.Network() == "unix" {
+ _ = os.Remove(listen.String())
+ }
+
log.AddField("http.listen", listen)
conn, err := net.Listen(listen.Network(), listen.String())
if err != nil {
@@ -52,6 +57,10 @@ func main() {
}
defer conn.Close()
+ if listen.Network() == "unix" {
+ _ = os.Chmod(listen.String(), 0660)
+ }
+
m := mux.NewRouter()
m.NotFoundHandler = httputil.NotFoundHandler