open-consul/terraform/aws/scripts/rhel_upstart.conf
Mike Cowgill fd8772f442 Update quick start AWS Terraform
This change started out as a quick update to RHEL 7 support (aka systemd), in
the process I realized most of the other platforms could use an update. While
trying to cleanup there I discovered I was repeating of bunch of information
that might be better maintained in one place - as a result:
 * consolidated server.sh and install.sh
 * removed upstart-join.conf in a favor of join flag in the consul start
 * removed platform specific folders and increased complexity of install.sh to
   include handling the differences
 * updated and extracted consul version
 * added a consistent ip_table.sh file to open ports on firewalls
 * updating consul service management configurations to enable proper restarting behavior for each platform
 * the configuration naming convention is <distro_origin>_file_name
 * added platform to the security group name so you can easily launch multpile platforms at once
 * fixes #1304
2016-03-10 06:22:24 -08:00

27 lines
613 B
Plaintext

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
if [ -f "/etc/service/consul" ]; then
. /etc/service/consul
fi
# Make sure to use all our CPUs, because Consul can block a scheduler thread
export GOMAXPROCS=`nproc`
# Get the public IP
BIND=`ifconfig eth0 | grep "inet addr" | awk '{ print substr($2,6) }'`
exec /usr/local/bin/consul agent \
-config-dir="/etc/consul.d" \
-bind=$BIND \
${CONSUL_FLAGS} \
>>/var/log/consul.log 2>&1
end script