diff --git a/.etcd.metadata b/.etcd.metadata index 07d2eaa..054f068 100644 --- a/.etcd.metadata +++ b/.etcd.metadata @@ -1 +1 @@ -b230653f183e5f737975575b8f5953f0fb932493 SOURCES/v2.0.11.tar.gz +1202ec27380c42a36314a286bfaa5ae9877045cc SOURCES/v2.0.13.tar.gz diff --git a/.gitignore b/.gitignore index 3ed8a4d..ea3bce9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/v2.0.11.tar.gz +SOURCES/v2.0.13.tar.gz diff --git a/SOURCES/don-t-set-GIT_SHA-in-build-script.patch b/SOURCES/don-t-set-GIT_SHA-in-build-script.patch index ceb65b7..7983e30 100644 --- a/SOURCES/don-t-set-GIT_SHA-in-build-script.patch +++ b/SOURCES/don-t-set-GIT_SHA-in-build-script.patch @@ -1,6 +1,6 @@ -From a5da60a9df487c6614d0f2b06db465f43154086b Mon Sep 17 00:00:00 2001 +From e87254b4a67d5ab4e23827cb876bc523d6799874 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka -Date: Wed, 20 May 2015 19:32:36 +0200 +Date: Mon, 29 Jun 2015 10:16:22 +0200 Subject: [PATCH] don't set GIT_SHA in build script --- @@ -8,15 +8,15 @@ Subject: [PATCH] don't set GIT_SHA in build script 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build -index 2bb96e5..b94d708 100755 +index e18ab25..7e83deb 100755 --- a/build +++ b/build @@ -11,7 +11,7 @@ ln -s ${PWD} $GOPATH/src/${REPO_PATH} eval $(go env) --GIT_SHA=`git rev-parse --short HEAD` -+#GIT_SHA=`git rev-parse --short HEAD` +-GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"` ++#GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"` # Static compilation is useful when etcd is run in a container CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA ${GIT_SHA}" -o bin/etcd ${REPO_PATH} diff --git a/SOURCES/etcd.conf b/SOURCES/etcd.conf index 7cad6e6..003a5fe 100644 --- a/SOURCES/etcd.conf +++ b/SOURCES/etcd.conf @@ -4,19 +4,19 @@ ETCD_DATA_DIR="/var/lib/etcd/default.etcd" #ETCD_SNAPSHOT_COUNTER="10000" #ETCD_HEARTBEAT_INTERVAL="100" #ETCD_ELECTION_TIMEOUT="1000" -#ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001" -ETCD_LISTEN_CLIENT_URLS="http://localhost:4001" +#ETCD_LISTEN_PEER_URLS="http://localhost:2380" +ETCD_LISTEN_CLIENT_URLS="http://localhost:2379" #ETCD_MAX_SNAPSHOTS="5" #ETCD_MAX_WALS="5" #ETCD_CORS="" # #[cluster] -#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380,http://localhost:7001" +#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380" # if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..." -#ETCD_INITIAL_CLUSTER="default=http://localhost:2380,default=http://localhost:7001" +#ETCD_INITIAL_CLUSTER="default=http://localhost:2380" #ETCD_INITIAL_CLUSTER_STATE="new" #ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" -ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" +ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379" #ETCD_DISCOVERY="" #ETCD_DISCOVERY_SRV="" #ETCD_DISCOVERY_FALLBACK="proxy" @@ -26,9 +26,16 @@ ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" #ETCD_PROXY="off" # #[security] -#ETCD_CA_FILE="" #ETCD_CERT_FILE="" #ETCD_KEY_FILE="" -#ETCD_PEER_CA_FILE="" +#ETCD_CLIENT_CERT_AUTH="false" +#ETCD_TRUSTED_CA_FILE="" #ETCD_PEER_CERT_FILE="" #ETCD_PEER_KEY_FILE="" +#ETCD_PEER_CLIENT_CERT_AUTH="false" +#ETCD_PEER_TRUSTED_CA_FILE="" +# +#[logging] +#ETCD_DEBUG="false" +# examples for -log-package-levels etcdserver=WARNING,security=DEBUG +#ETCD_LOG_PACKAGE_LEVELS="" diff --git a/SOURCES/etcd.service b/SOURCES/etcd.service index 240a948..263bc2d 100644 --- a/SOURCES/etcd.service +++ b/SOURCES/etcd.service @@ -9,6 +9,8 @@ EnvironmentFile=-/etc/etcd/etcd.conf User=etcd # set GOMAXPROCS to number of processors ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd" +Restart=on-failure +LimitNOFILE=65536 [Install] WantedBy=multi-user.target diff --git a/SOURCES/set-etcd-advertise-client-urls-if-needed.patch b/SOURCES/set-etcd-advertise-client-urls-if-needed.patch new file mode 100644 index 0000000..ea7e38c --- /dev/null +++ b/SOURCES/set-etcd-advertise-client-urls-if-needed.patch @@ -0,0 +1,32 @@ +From 22702c228513ef21d3b9fdc6d28220cafb64cd3c Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Tue, 7 Jul 2015 03:04:57 +0200 +Subject: [PATCH] set ETCD_ADVERTISE_CLIENT_URLS if needed + +--- + main.go | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/main.go b/main.go +index d627fb0..844b175 100644 +--- a/main.go ++++ b/main.go +@@ -24,7 +24,15 @@ + package main + + import "github.com/coreos/etcd/etcdmain" ++import "os" ++import "log" + + func main() { ++ etcd_listen_client_urls := os.Getenv("ETCD_LISTEN_CLIENT_URLS") ++ if etcd_listen_client_urls != "" && ++ os.Getenv("ETCD_ADVERTISE_CLIENT_URLS") == "" { ++ if os.Setenv("ETCD_ADVERTISE_CLIENT_URLS", etcd_listen_client_urls) == nil { ++ log.Printf("etcd: ETCD_LISTEN_CLIENT_URLS set but ETCD_ADVERTISE_CLIENT_URLS not, setting ETCD_ADVERTISE_CLIENT_URLS to ETCD_ADVERTISE_CLIENT_URLS")} ++ } + etcdmain.Main() + } +-- +1.9.3 + diff --git a/SPECS/etcd.spec b/SPECS/etcd.spec index ce142ff..9d20b21 100644 --- a/SPECS/etcd.spec +++ b/SPECS/etcd.spec @@ -1,4 +1,9 @@ -%if 0%{?fedora} +%global with_devel 0 +%global with_bundled 1 +%global with_debug 0 +%global with_check 0 + +%if 0%{?with_debug} # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %else @@ -8,13 +13,13 @@ %global provider_tld com %global project coreos %global repo etcd -%global commit 0678329cd64a64d7478eae6c35ed0bea0346da86 +%global commit 92e3895214265d213de5b1ff55cddf482f0d1ed5 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} Name: %{repo} -Version: 2.0.11 +Version: 2.0.13 Release: 2%{?dist} Summary: A highly-available key value store for shared configuration License: ASL 2.0 @@ -23,14 +28,17 @@ Source0: https://%{import_path}/archive/v%{version}.tar.gz Source1: %{name}.service Source2: %{name}.conf +%if ! 0%{?with_bundled} +Patch0: etcd-2.0.1-Replace-depricated-ErrWrongType-with-its-local-defin.patch +%else Patch0: don-t-set-GIT_SHA-in-build-script.patch -%if 0%{?fedora} -Patch1: etcd-2.0.1-Replace-depricated-ErrWrongType-with-its-local-defin.patch %endif +Patch1: set-etcd-advertise-client-urls-if-needed.patch + ExclusiveArch: %{ix86} x86_64 %{arm} BuildRequires: golang >= 1.2.1-3 -%if 0%{?fedora} +%if ! 0%{?with_bundled} BuildRequires: golang(code.google.com/p/gogoprotobuf/proto) BuildRequires: golang(github.com/codegangsta/cli) BuildRequires: golang(github.com/coreos/go-etcd/etcd) @@ -47,7 +55,7 @@ Requires(postun): systemd %description A highly-available key value store for shared configuration. -%if 0%{?fedora} +%if 0%{?with_devel} %package devel BuildRequires: golang >= 1.2.1-3 BuildRequires: golang(code.google.com/p/gogoprotobuf/proto) @@ -56,7 +64,12 @@ BuildRequires: golang(github.com/coreos/go-etcd/etcd) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(github.com/jonboulle/clockwork) BuildRequires: golang(github.com/stretchr/testify/assert) -Requires: golang >= 1.2.1-3 +Requires: golang(code.google.com/p/gogoprotobuf/proto) +Requires: golang(github.com/codegangsta/cli) +Requires: golang(github.com/coreos/go-etcd/etcd) +Requires: golang(golang.org/x/net/context) +Requires: golang(github.com/jonboulle/clockwork) +Requires: golang(github.com/stretchr/testify/assert) Provides: golang(%{import_path}/client) = %{version}-%{release} Provides: golang(%{import_path}/discovery) = %{version}-%{release} Provides: golang(%{import_path}/error) = %{version}-%{release} @@ -69,7 +82,6 @@ Provides: golang(%{import_path}/etcdserver/etcdserverpb) = %{version}-%{release} Provides: golang(%{import_path}/etcdserver/stats) = %{version}-%{release} Provides: golang(%{import_path}/integration) = %{version}-%{release} Provides: golang(%{import_path}/migrate) = %{version}-%{release} -Provides: golang(%{import_path}/migrate/etcd4pb) = %{version}-%{release} Provides: golang(%{import_path}/pkg/coreos) = %{version}-%{release} Provides: golang(%{import_path}/pkg/cors) = %{version}-%{release} Provides: golang(%{import_path}/pkg/crc) = %{version}-%{release} @@ -107,7 +119,7 @@ shared configuration. %prep %setup -qn %{name}-%{version} -%if 0%{?fedora} +%if ! 0%{?with_bundled} rm -rf Godeps/_workspace/src/github.com/{codegangsta,coreos,stretchr,jonboulle} rm -rf Godeps/_workspace/src/{code.google.com,bitbucket.org,golang.org} @@ -117,16 +129,23 @@ find . -name "*.go" \ %endif %patch0 -p1 +%patch1 -p1 %build -%if 0%{?fedora} +%if ! 0%{?with_bundled} # Make link for etcd itself mkdir -p src/github.com/coreos ln -s ../../../ src/github.com/coreos/etcd export GOPATH=$(pwd):%{gopath}:$GOPATH + +%if 0%{?with_debug} # *** ERROR: No build ID note found in /.../BUILDROOT/etcd-2.0.0-1.rc1.fc22.x86_64/usr/bin/etcd -function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; } +function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -s -X %{import_path}/version.GitSHA %{shortcommit}" -v -x "$@"; } +%else +function gobuild { go build -a "$@" -ldflags "-s -X %{import_path}/version.GitSHA %{shortcommit}"; } +%endif + gobuild -o bin/etcd %{import_path} gobuild -o bin/etcdctl %{import_path}/etcdctl gobuild -o bin/etcd-migrate %{import_path}/tools/%{name}-migrate @@ -140,8 +159,10 @@ export GIT_SHA=%{shortcommit} install -D -p -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name} install -D -p -m 0755 bin/%{name}ctl %{buildroot}%{_bindir}/%{name}ctl %if 0%{?fedora} +%if ! 0%{?with_bundled} install -D -p -m 0755 bin/%{name}-migrate %{buildroot}%{_bindir}/%{name}-migrate %endif +%endif install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name} install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} @@ -150,7 +171,7 @@ install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} # And create /var/lib/etcd install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} -%if 0%{?fedora} +%if 0%{?with_devel} # Install files for devel sub-package install -d %{buildroot}/%{gopath}/src/%{import_path} cp -pav main.go %{buildroot}/%{gopath}/src/%{import_path}/ @@ -163,8 +184,12 @@ done %endif %check -%if 0%{?fedora} +%if 0%{?with_check} +%if 0%{?with_bundled} +export GOPATH=$(pwd)/Godeps/_workspace:%{gopath} +%else export GOPATH=%{buildroot}%{gopath}:%{gopath} +%endif go test %{import_path}/client go test %{import_path}/discovery go test %{import_path}/error @@ -175,21 +200,28 @@ go test %{import_path}/etcdmain #go test %{import_path}/etcdserver/etcdhttp/httptypes #go test %{import_path}/integration go test %{import_path}/migrate +#go test %{import_path}/pkg/cors +go test %{import_path}/pkg/crc #go test %{import_path}/pkg/fileutil go test %{import_path}/pkg/flags +go test %{import_path}/pkg/idutil go test %{import_path}/pkg/ioutil +go test %{import_path}/pkg/metrics +go test %{import_path}/pkg/netutil +go test %{import_path}/pkg/osutil +go test %{import_path}/pkg/pbutil +go test %{import_path}/pkg/timeutil #go test %{import_path}/pkg/transport go test %{import_path}/pkg/types go test %{import_path}/pkg/wait go test %{import_path}/proxy go test %{import_path}/raft +#go test %{import_path}/raft/rafttest go test %{import_path}/rafthttp go test %{import_path}/snap #go test %{import_path}/store +go test %{import_path}/version go test %{import_path}/wal -%else -#./cover // requires golang cover -#./test // requires golang cover %endif %pre @@ -211,14 +243,16 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %{_bindir}/%{name} %{_bindir}/%{name}ctl %if 0%{?fedora} +%if ! 0%{?with_bundled} %{_bindir}/%{name}-migrate %endif +%endif %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %doc LICENSE README.md Documentation/internal-protocol-versioning.md %doc Godeps/Godeps.json -%if 0%{?fedora} +%if 0%{?with_devel} %files devel %doc LICENSE README.md Documentation/internal-protocol-versioning.md %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} @@ -227,6 +261,26 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %endif %changelog +* Wed Jul 01 2015 jchaloup - 2.0.13-2 +- Set implicit value for ETCD_ADVERTISE_CLIENT_URLS if not set accordingly. + Config files of etcd < 2.0.11-2 does not set ETCD_ADVERTISE_CLIENT_URLS + if ETCD_LISTEN_CLIENT_URLS is. Causing etcd to fail when updated to newer etcd. + resolves: #1236706 + +* Fri Jun 26 2015 jchaloup - 2.0.13-1 +- Update to v2.0.13 + resolves: #1232142 + +* Thu Jun 25 2015 jchaloup - 2.0.12-2 +- Add restart policy and set LimitNOFILE to/in etcd.service file +- Update etcd.config file: add new flags and remove depricated +- Update 'go build' flags for GIT_SHA (used in build script) +- Don't use 4001 and 7001 ports in etcd.conf, they are replaced with 2379 and 2380 + +* Wed Jun 24 2015 jchaloup - 2.0.12-1 +- Update to v2.0.12 +- Polish spec file + * Fri May 22 2015 jchaloup - 2.0.11-2 - ETCD_ADVERTISE_CLIENT_URLS has to be set if ETCD_LISTEN_CLIENT_URLS is set GOMAXPROCS to use all processors available