Skip to content

Instantly share code, notes, and snippets.

@dellis23
Created February 17, 2015 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dellis23/49862d39a4f355e1b3e2 to your computer and use it in GitHub Desktop.
Save dellis23/49862d39a4f355e1b3e2 to your computer and use it in GitHub Desktop.
description "Consul server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
# Make sure to use all our CPUs, because Consul can block a scheduler thread
export GOMAXPROCS=`nproc`
BIND=`ifconfig docker0 | grep "inet addr" | awk '{ print substr($2,6) }'`
# Allow overriding env vars in /etc/default/consul
if [ -f "/etc/default/consul" ]; then
. /etc/default/consul
fi
exec /usr/bin/consul agent \
-config-dir="/etc/consul.d" \
-data-dir="/var/lib/consul/" \
-syslog \
-server \
-bootstrap \
-bind=$BIND \
${CONSUL_FLAGS}
end script
@dellis23
Copy link
Author

I can't get some pretty syntax highlighting to save my life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment