summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/consul/files
diff options
context:
space:
mode:
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 0000000..a66e1dc
--- /dev/null
+++ b/recipes-connectivity/consul/files/0001-prepared_query-make-compatible-with-go1.5.patch
@@ -0,0 +1,31 @@
1From fb11d9e31788c912f94faf8b188278d54dc9a8f1 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Wed, 20 Apr 2016 16:34:50 -0400
4Subject: [PATCH] prepared_query: make compatible with go1.5
5
6The copying of a regex is only in go 1.6. We can take the chance of
7lock contention, so we drop the copy and use the regex directly.
8
9Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
10---
11 consul/prepared_query/template.go | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/consul/prepared_query/template.go b/consul/prepared_query/template.go
15index 984f0bcf9cc6..1c61910c1526 100644
16--- a/consul/prepared_query/template.go
17+++ b/consul/prepared_query/template.go
18@@ -116,8 +116,8 @@ func (ct *CompiledTemplate) Render(name string) (*structs.PreparedQuery, error)
19 // from multiple goroutines.
20 var matches []string
21 if ct.re != nil {
22- re := ct.re.Copy()
23- matches = re.FindStringSubmatch(name)
24+ // re := ct.re.Copy()
25+ matches = ct.re.FindStringSubmatch(name)
26 }
27
28 // Create a safe match function that can't fail at run time. It will
29--
302.4.0.53.g8440f74
31
diff --git a/recipes-connectivity/consul/files/consul.service b/recipes-connectivity/consul/files/consul.service
new file mode 100644
index 0000000..c9494e3
--- /dev/null
+++ b/recipes-connectivity/consul/files/consul.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=Launch Consul Cluster
3
4[Service]
5Restart=on-failure
6RestartSec=45
7ExecStartPre=/bin/sh -c 'echo -ne \'{"data_dir":\"/var/consul","server":true,"bootstrap_expect":1,\' > /tmp/consul.conf'
8ExecStartPre=/bin/sh -c 'echo -ne \'"bind_addr":"\'$(ifconfig br0 | awk \'/inet addr/{print substr($2,6)}\')\'"}\' >> /tmp/consul.conf'
9ExecStart=/usr/bin/consul agent -config-file=/tmp/consul.conf
10
11[Install]
12WantedBy=multi-user.target