github.hscsec.cn/hashicorp/consul@v1.4.5/terraform/openstack/scripts/upstart-join.conf (about)

     1  description "Join the consul cluster"
     2  
     3  start on started consul
     4  stop on stopped consul
     5  
     6  task
     7  
     8  script
     9    if [ -f "/etc/service/consul-join" ]; then
    10      . /etc/service/consul-join
    11    fi
    12  
    13    # Keep trying to join until it succeeds
    14    set +e
    15    while :; do
    16      logger -t "consul-join" "Attempting join: ${CONSUL_JOIN}"
    17      /usr/local/bin/consul join \
    18        ${CONSUL_JOIN} \
    19        >>/var/log/consul-join.log 2>&1
    20      [ $? -eq 0 ] && break
    21      sleep 5
    22    done
    23  
    24    logger -t "consul-join" "Join success!"
    25  end script