github.com/outbrain/consul@v1.4.5/terraform/shared/scripts/debian_upstart.conf (about)

     1  description "Consul agent"
     2  
     3  start on started networking
     4  stop on runlevel [!2345]
     5  
     6  respawn
     7  # This is to avoid Upstart re-spawning the process upon `consul leave`
     8  normal exit 0 INT
     9  
    10  script
    11    if [ -f "/etc/service/consul" ]; then
    12      . /etc/service/consul
    13    fi
    14  
    15    # Get the local IP
    16    BIND=`ifconfig eth0 | grep "inet addr" | awk '{ print substr($2,6) }'`
    17  
    18    exec /usr/local/bin/consul agent \
    19      -config-dir="/etc/consul.d" \
    20      -bind=$BIND \
    21      ${CONSUL_FLAGS} \
    22      >>/var/log/consul.log 2>&1
    23  end script
    24