Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a helper shell script to wait for consul startup #67

Closed
gozer opened this issue Mar 3, 2015 · 3 comments
Closed

provide a helper shell script to wait for consul startup #67

gozer opened this issue Mar 3, 2015 · 3 comments
Assignees
Labels

Comments

@gozer
Copy link
Contributor

gozer commented Mar 3, 2015

Something like this should do the trick

We run early, so we need to account for Consul's startup time, unfortunately, magic isn't

always free

CONSUL_UP=-1
while [ "$CONSUL_UP" != "0" ]; do
QUERY=curl -s http://localhost:8500/v1/kv
CONSUL_UP=$?

if [ "$QUERY" != "" ]; then
CONSUL_UP=-2
fi

echo "Consul not ready yet ($CONSUL_UP), retrying..."
sleep 1
done

@bhourigan
Copy link
Contributor

Indent the script, please

@gozer gozer added feature and removed enhancement labels Jun 11, 2015
@gozer gozer modified the milestones: v1.1, v1.1.0 Jun 15, 2015
@limed
Copy link
Contributor

limed commented Jul 24, 2015

I actually wrote a proof of concept on this here

@limed
Copy link
Contributor

limed commented Jul 24, 2015

Of course that branch is missing some plumbing to make packer copy over to all base images. And then its a matter of just adding the following lines in a migrate script/whatever script that wants to use it

 [ -e /usr/local/lib/nubis/nubis-lib.sh ] && . /usr/local/lib/nubis/nubis-lib.sh || exit 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants