Skip to content

Instantly share code, notes, and snippets.

@daveadams
Created June 1, 2016 17:51
Show Gist options
  • Save daveadams/069bc2f636e7c04745054fee94f02ec5 to your computer and use it in GitHub Desktop.
Save daveadams/069bc2f636e7c04745054fee94f02ec5 to your computer and use it in GitHub Desktop.
Consul upstart config
description "Consul Agent"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on stopping network-services
respawn
console none
setuid consul
setgid consul
env CONSUL_CONF_DIR=/etc/consul.d
script
export GOMAXPROCS=`nproc`
. /etc/default/consul
exec /usr/local/bin/consul agent -config-dir=${CONSUL_CONF_DIR} ${CONSUL_FLAGS}
end script
pre-stop exec /usr/local/bin/consul leave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment