Skip to content

Instantly share code, notes, and snippets.

@logikal
Created May 27, 2014 06:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save logikal/ccc91f1c826e5241a6a6 to your computer and use it in GitHub Desktop.
Save logikal/ccc91f1c826e5241a6a6 to your computer and use it in GitHub Desktop.
consul upstart script
description "the consul service"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
pre-stop exec consul leave
respawn
umask 022
chdir /
setuid root
setgid root
console log # log stdout/stderr to /var/log/upstart/
export GOMAXPROCS=`nproc`
exec consul agent \
"--config-dir=/etc/consul" \
${CONSUL_FLAGS} \
>> /var/log/consul.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment