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` # server join SERVER_JOIN=$(sed 's/ip/ -retry-join=ip/' /etc/service/nomad/servers.conf) exec /usr/local/bin/nomad agent \ -config="/etc/service/nomad/default.conf" \ ${SERVER_JOIN} \ >>/var/log/nomad.log 2>&1 end script