9706: Notify systemd when crunch-dispatch-slurm is ready.
authorTom Clegg <tom@curoverse.com>
Mon, 15 Aug 2016 20:58:02 +0000 (16:58 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 23 Aug 2016 17:28:18 +0000 (13:28 -0400)
services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
services/crunch-dispatch-slurm/crunch-dispatch-slurm.service

index 1d9015d5051f0a678a834ba56781377d39a4b96c..8686fa4284f7f785cccfe8466a7ec99da96f4289 100644 (file)
@@ -9,6 +9,7 @@ import (
        "git.curoverse.com/arvados.git/sdk/go/arvados"
        "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
        "git.curoverse.com/arvados.git/sdk/go/dispatch"
+       "github.com/coreos/go-systemd/daemon"
        "io"
        "io/ioutil"
        "log"
@@ -105,6 +106,10 @@ func doMain() error {
                PollInterval:   time.Duration(config.PollPeriod),
                DoneProcessing: make(chan struct{})}
 
+       if _, err := daemon.SdNotify("READY=1"); err != nil {
+               log.Printf("Error notifying init daemon: %v", err)
+       }
+
        err = dispatcher.RunDispatcher()
        if err != nil {
                return err
index eac8d89db2d08a3d968cb0063b935b52bd6c23b2..5b37e3c0a34f9d4a2678e629ce5ddd8facdc5737 100644 (file)
@@ -4,7 +4,7 @@ Documentation=https://doc.arvados.org/
 After=network.target
 
 [Service]
-Type=simple
+Type=notify
 ExecStart=/usr/bin/crunch-dispatch-slurm
 Restart=always