diff --git a/Notify-systemd-service-when-server-is-ready-to-liste.patch b/Notify-systemd-service-when-server-is-ready-to-liste.patch new file mode 100644 index 0000000..22655a3 --- /dev/null +++ b/Notify-systemd-service-when-server-is-ready-to-liste.patch @@ -0,0 +1,33 @@ +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 + diff --git a/flannel-tmpfiles.conf b/flannel-tmpfiles.conf new file mode 100644 index 0000000..1516e44 --- /dev/null +++ b/flannel-tmpfiles.conf @@ -0,0 +1 @@ +d /run/flannel 0755 root root - diff --git a/flannel.spec b/flannel.spec index 11f6c0a..8169b70 100644 --- a/flannel.spec +++ b/flannel.spec @@ -28,7 +28,7 @@ Name: flannel Version: 0.5.3 -Release: 3%{?dist} +Release: 5%{?dist} Summary: Etcd address management agent for overlay networks License: ASL 2.0 URL: https://%{import_path} @@ -37,9 +37,11 @@ Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}. Source1: flanneld.sysconf Source2: flanneld.service Source3: flannel-docker.conf +Source4: flannel-tmpfiles.conf Patch0: change-4001-to-2379-in-help-and-README.patch Patch1: change-coreos.com-network-to-atomic.io-network-in-he.patch +Patch2: Notify-systemd-service-when-server-is-ready-to-liste.patch ExclusiveArch: %{ix86} x86_64 %{arm} @@ -133,6 +135,7 @@ building other packages which use %{project}/%{repo}. %setup -q -n %{repo}-%{commit} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %if ! 0%{?with_bundled} find . -name "*.go" \ @@ -169,6 +172,10 @@ install -D -p -m 644 %{SOURCE1} %{buildroot}/etc/sysconfig/flanneld install -D -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/flanneld.service install -D -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/docker.service.d/flannel.conf install -D -p -m 755 dist/mk-docker-opts.sh %{buildroot}%{_libexecdir}/flannel/mk-docker-opts.sh +install -D -p -m 0755 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf + +mkdir -p %{buildroot}/run +install -d -m 0755 %{buildroot}/run/%{name}/ %if 0%{?with_devel} # devel package @@ -201,6 +208,8 @@ go test %{import_path}/subnet %{_unitdir}/docker.service.d/flannel.conf %{_libexecdir}/flannel/mk-docker-opts.sh %config(noreplace) %{_sysconfdir}/sysconfig/flanneld +%dir /run/%{name}/ +%{_tmpfilesdir}/%{name}.conf %if 0%{?with_devel} %files devel @@ -211,6 +220,13 @@ go test %{import_path}/subnet %endif %changelog +* Wed Sep 23 2015 jchaloup - 0.5.3-5 +- Flannel now owns /run/flannel directory + +* Wed Sep 23 2015 jchaloup - 0.5.3-4 +- Send systemd notification when -listen is used +- Create /run/flannel directory for mk-docker-opts.sh + * Thu Sep 17 2015 jchaloup - 0.5.3-3 - Change coreos.com/network to atomic.io/network in help and docs