ソースを参照

Merge pull request #326 from ingvagabund/flanneld-listen-systemd-service-not-notified

Notify systemd service when server is ready to listen
Eugene Yakubovich 9 年 前
コミット
e6647ac235
1 ファイル変更3 行追加0 行削除
  1. 3 0
      remote/server.go

+ 3 - 0
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()