2017-05-15 18:56:41 +00:00
|
|
|
description "Consul"
|
|
|
|
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
|
|
|
|
|
|
|
respawn
|
|
|
|
|
|
|
|
console log
|
|
|
|
|
|
|
|
script
|
|
|
|
if [ -f "/etc/service/consul" ]; then
|
|
|
|
. /etc/service/consul
|
|
|
|
fi
|
|
|
|
|
2017-07-07 16:48:19 +00:00
|
|
|
# Allow Consul to use privileged ports
|
2017-06-24 23:25:46 +00:00
|
|
|
export CONSUL_ALLOW_PRIVILEGED_PORTS=true
|
2017-05-15 18:56:41 +00:00
|
|
|
|
|
|
|
exec /usr/local/bin/consul agent \
|
|
|
|
-config-dir="/etc/consul.d" \
|
2017-06-24 23:25:46 +00:00
|
|
|
-dns-port="53" \
|
|
|
|
-recursor="172.31.0.2" \
|
2017-05-15 18:56:41 +00:00
|
|
|
\$${CONSUL_FLAGS} \
|
|
|
|
>>/var/log/consul.log 2>&1
|
|
|
|
end script
|