From 9b8ad465d7ff58cb030b573609b4d4dae2382ad4 Mon Sep 17 00:00:00 2001 From: "Kelvin Ly (on the cloud)" Date: Fri, 28 Sep 2018 02:10:37 +0000 Subject: [PATCH] Fix the service file so it should work from startup --- kelvinly-server.service | 3 ++- main.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kelvinly-server.service b/kelvinly-server.service index 908e034..bdeb560 100644 --- a/kelvinly-server.service +++ b/kelvinly-server.service @@ -3,7 +3,8 @@ Description=My main HTTP server After=network.target syslog.target [Service] -Type=oneshot +Type=forking +PIDFile=/tmp/kelvinly-server-pid ExecStart=/home/kelvin/kelvinly-server/kelvinly-server StandardOutput=syslog StandardError=syslog diff --git a/main.go b/main.go index 5a85f68..33bda04 100644 --- a/main.go +++ b/main.go @@ -99,7 +99,7 @@ func main() { PidFilePerm: 0644, LogFileName: "/tmp/kelvinly-server-log", LogFilePerm: 0640, - WorkDir: "./", + WorkDir: "/home/kelvin/kelvinly-server/", Umask: 027, } // TODO: figure out the daemonizing stuff