From 0fb494f0fda8e97968b222d43ef9b42704c9482e Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Mon, 25 Apr 2022 00:12:49 +0200 Subject: [PATCH] [fix] systemd config update & http service fix --- init/api-server.service | 11 +++++++---- internal/app/server.go | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/init/api-server.service b/init/api-server.service index f6519e2..a112b9d 100644 --- a/init/api-server.service +++ b/init/api-server.service @@ -6,13 +6,16 @@ After=network-online.target Requires=api-server.socket [Service] -ExecStart=/home/keedosn/go/src/git.pbiernat.dev/api-prototype/build/server +ExecStart=/home/keedosn/go/src/git.pbiernat.dev/golang/rest-api-prototype/build/server ExecStop=/bin/kill $MAINPID -WorkingDirectory=/home/keedosn/go/src/git.pbiernat.dev/api-prototype +WorkingDirectory=/home/keedosn/go/src/git.pbiernat.dev/golang/rest-api-prototype User=keedosn Group=keedosn NonBlocking=true -StandardOutput=append:/home/keedosn/go/src/git.pbiernat.dev/api-prototype/build/err.log -StandardError=append:/home/keedosn/go/src/git.pbiernat.dev/api-prototype/build/err.log +StandardOutput=append:/home/keedosn/go/src/git.pbiernat.dev/golang/rest-api-prototype/build/api-server.log +StandardError=append:/home/keedosn/go/src/git.pbiernat.dev/golang/rest-api-prototype/build/api-server.log SyslogIdentifier=api-server +[Install] +WantedBy=multi-user.target + diff --git a/internal/app/server.go b/internal/app/server.go index 2ede3f0..33d5967 100644 --- a/internal/app/server.go +++ b/internal/app/server.go @@ -41,7 +41,7 @@ func (s *Server) Start() { } log.Println("Server listening on " + l.Addr().String()) - http.Serve(l, nil) + s.Serve(l) } else { log.Println("Server listening on " + s.Addr)