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

     1  description "Consul agent"
     2  
     3  start on started network
     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    # Make sure to use all our CPUs, because Consul can block a scheduler thread
    16    export GOMAXPROCS=`nproc`
    17  
    18    # Get the public IP
    19    BIND=`ifconfig eth0 | grep "inet addr" | awk '{ print substr($2,6) }'`
    20  
    21    exec /usr/local/bin/consul agent \
    22      -config-dir="/etc/consul.d" \
    23      -bind=$BIND \
    24      ${CONSUL_FLAGS} \
    25      >>/var/log/consul.log 2>&1
    26  end script