aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/consul/files
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2018-09-18 16:27:27 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-09-25 17:40:49 -0400
commitdaaecc315c96f6757a20ca5979c7889c0df02ec9 (patch)
tree69fc4ddff707d3469b365d7b83e32f57efbe1640 /recipes-connectivity/consul/files
parent492de1f32fc0053b692e3173ea6d3d19052f7c97 (diff)
downloadmeta-cloud-services-daaecc315c96f6757a20ca5979c7889c0df02ec9.tar.gz
meta-cloud-services-daaecc315c96f6757a20ca5979c7889c0df02ec9.tar.bz2
meta-cloud-services-daaecc315c96f6757a20ca5979c7889c0df02ec9.zip
consul: consule-migrate: move from meta-overc
After several requests to make the consul recipe available outside of meta-overc and the OverC framework we are moving the consul recipes here. These are a copy from meta-overc (HEAD 6afe8d2c12ac). NOTE that not all the DEPENDS have been copied as we will follow this commit with work to make use of SRC_URIs for dependencies. See the associated commit(s) which will follow this one. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-connectivity/consul/files')
-rw-r--r--recipes-connectivity/consul/files/0001-prepared_query-make-compatible-with-go1.5.patch31
-rw-r--r--recipes-connectivity/consul/files/consul.service12
2 files changed, 43 insertions, 0 deletions
diff --git a/recipes-connectivity/consul/files/0001-prepared_query-make-compatible-with-go1.5.patch b/recipes-connectivity/consul/files/0001-prepared_query-make-compatible-with-go1.5.patch
new file mode 100644
index 00000000..a66e1dca
--- /dev/null
+++ b/recipes-connectivity/consul/files/0001-prepared_query-make-compatible-with-go1.5.patch
@@ -0,0 +1,31 @@
+From fb11d9e31788c912f94faf8b188278d54dc9a8f1 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Wed, 20 Apr 2016 16:34:50 -0400
+Subject: [PATCH] prepared_query: make compatible with go1.5
+
+The copying of a regex is only in go 1.6. We can take the chance of
+lock contention, so we drop the copy and use the regex directly.
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ consul/prepared_query/template.go | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/consul/prepared_query/template.go b/consul/prepared_query/template.go
+index 984f0bcf9cc6..1c61910c1526 100644
+--- a/consul/prepared_query/template.go
++++ b/consul/prepared_query/template.go
+@@ -116,8 +116,8 @@ func (ct *CompiledTemplate) Render(name string) (*structs.PreparedQuery, error)
+ // from multiple goroutines.
+ var matches []string
+ if ct.re != nil {
+- re := ct.re.Copy()
+- matches = re.FindStringSubmatch(name)
++ // re := ct.re.Copy()
++ matches = ct.re.FindStringSubmatch(name)
+ }
+
+ // Create a safe match function that can't fail at run time. It will
+--
+2.4.0.53.g8440f74
+
diff --git a/recipes-connectivity/consul/files/consul.service b/recipes-connectivity/consul/files/consul.service
new file mode 100644
index 00000000..c9494e31
--- /dev/null
+++ b/recipes-connectivity/consul/files/consul.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Launch Consul Cluster
+
+[Service]
+Restart=on-failure
+RestartSec=45
+ExecStartPre=/bin/sh -c 'echo -ne \'{"data_dir":\"/var/consul","server":true,"bootstrap_expect":1,\' > /tmp/consul.conf'
+ExecStartPre=/bin/sh -c 'echo -ne \'"bind_addr":"\'$(ifconfig br0 | awk \'/inet addr/{print substr($2,6)}\')\'"}\' >> /tmp/consul.conf'
+ExecStart=/usr/bin/consul agent -config-file=/tmp/consul.conf
+
+[Install]
+WantedBy=multi-user.target