From c623d5666ef076de1b79c7b86d72a9d68847f672 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Wed, 23 Sep 2015 09:40:46 +0200 Subject: [PATCH] Notify systemd service when server is ready to listen --- remote/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/remote/server.go b/remote/server.go index a39f80c..6d6fb05 100644 --- a/remote/server.go +++ b/remote/server.go @@ -26,6 +26,7 @@ import ( "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport" "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-systemd/activation" + "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-systemd/daemon" log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog" "github.com/coreos/flannel/Godeps/_workspace/src/github.com/gorilla/mux" "github.com/coreos/flannel/Godeps/_workspace/src/golang.org/x/net/context" @@ -276,6 +277,8 @@ func RunServer(ctx context.Context, sm subnet.Manager, listenAddr, cafile, certf c <- http.Serve(l, httpLogger(r)) }() + daemon.SdNotify("READY=1") + select { case <-ctx.Done(): l.Close() -- 1.9.3