@@ -22,7 +22,7 @@ if [[ ! -d /var/lib/postgresql/9.3/main ]]; then
2222fi
2323
2424# wait for etcd to be available
25- until etcdctl -C $ETCD ls > /dev/null; do
25+ until etcdctl --no-sync - C $ETCD ls > /dev/null; do
2626 echo " waiting for etcd at $ETCD ..."
2727 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
2828done
3131sleep $(( $ETCD_TTL + 1 ))
3232
3333# seed initial service configuration if necessary
34- if ! etcdctl -C $ETCD ls $ETCD_PATH > /dev/null 2>&1 ; then
35- etcdctl -C $ETCD set $ETCD_PATH /engine postgresql_psycopg2 > /dev/null
36- etcdctl -C $ETCD set $ETCD_PATH /adminUser ${PG_ADMIN_USER:- postgres} > /dev/null
37- etcdctl -C $ETCD set $ETCD_PATH /adminPass ${PG_ADMIN_PASS:- changeme123} > /dev/null
38- etcdctl -C $ETCD set $ETCD_PATH /user ${PG_USER_NAME:- deis} > /dev/null
39- etcdctl -C $ETCD set $ETCD_PATH /password ${PG_USER_PASS:- changeme123} > /dev/null
40- etcdctl -C $ETCD set $ETCD_PATH /name ${PG_USER_DB:- deis} > /dev/null
34+ if ! etcdctl --no-sync - C $ETCD ls $ETCD_PATH > /dev/null 2>&1 ; then
35+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /engine postgresql_psycopg2 > /dev/null
36+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /adminUser ${PG_ADMIN_USER:- postgres} > /dev/null
37+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /adminPass ${PG_ADMIN_PASS:- changeme123} > /dev/null
38+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /user ${PG_USER_NAME:- deis} > /dev/null
39+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /password ${PG_USER_PASS:- changeme123} > /dev/null
40+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /name ${PG_USER_DB:- deis} > /dev/null
4141fi
4242
4343# wait for confd to run once and install initial templates
@@ -85,8 +85,8 @@ if [[ ! -z $PUBLISH ]]; then
8585
8686 # while the port is listening, publish to etcd
8787 while [[ ! -z $( netstat -lnt | awk " \$ 6 == \" LISTEN\" && \$ 4 ~ \" .$PUBLISH \" && \$ 1 ~ \" $PROTO .?\" " ) ]] ; do
88- etcdctl -C $ETCD set $ETCD_PATH /host $HOST --ttl $ETCD_TTL > /dev/null
89- etcdctl -C $ETCD set $ETCD_PATH /port $PORT --ttl $ETCD_TTL > /dev/null
88+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /host $HOST --ttl $ETCD_TTL > /dev/null
89+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /port $PORT --ttl $ETCD_TTL > /dev/null
9090 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
9191 done
9292
0 commit comments