description "Consul agent" start on started network stop on runlevel [!2345] respawn # This is to avoid Upstart re-spawning the process upon `consul leave` normal exit 0 INT script # Make sure to use all our CPUs, because Consul can block a scheduler thread export GOMAXPROCS=`nproc` exec /usr/local/bin/consul-template \ -consul 127.0.0.1:8500 \ -template "/etc/consul-template.d/nginx.ctmpl:/etc/nginx/nginx.conf:service nginx reload" \ -template "/etc/consul-template.d/hosts.ctmpl:/etc/hosts" \ >> /var/log/consul-template.log 2>&1 end script