From ec8f01cc84b75ab2cb9204cab63636a1a479a893 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Tue, 20 Sep 2016 21:28:00 -0400 Subject: [PATCH] 9950: Add systemd unit file arv-git-httpd.service. --- services/arv-git-httpd/arv-git-httpd.service | 12 ++++++++++++ services/arv-git-httpd/main.go | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 services/arv-git-httpd/arv-git-httpd.service diff --git a/services/arv-git-httpd/arv-git-httpd.service b/services/arv-git-httpd/arv-git-httpd.service new file mode 100644 index 0000000000..1182a0eaf9 --- /dev/null +++ b/services/arv-git-httpd/arv-git-httpd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Arvados git server +Documentation=https://doc.arvados.org/ +After=network.target + +[Service] +Type=notify +ExecStart=/usr/bin/arv-git-httpd +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index ce18b713d7..ccee20e84b 100644 --- a/services/arv-git-httpd/main.go +++ b/services/arv-git-httpd/main.go @@ -9,6 +9,7 @@ import ( "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/config" + "github.com/coreos/go-systemd/daemon" ) // Server configuration @@ -77,6 +78,9 @@ func main() { if err := srv.Start(); err != nil { log.Fatal(err) } + if _, err := daemon.SdNotify("READY=1"); err != nil { + log.Printf("Error notifying init daemon: %v", err) + } log.Println("Listening at", srv.Addr) log.Println("Repository root", theConfig.RepoRoot) if err := srv.Wait(); err != nil { -- 2.30.2