Skip to content

Commit 101c88b

Browse files
author
Matthew Fisher
committed
fix(*): be more permissive with etcd
If etcd failed to publish either due to a lock or some other behavior, it would fail and the systemd unit would suddenly stop. This makes bin/boot more permissive around failing to publish to etcd.
1 parent 7dc4a3a commit 101c88b

7 files changed

Lines changed: 14 additions & 1 deletion

File tree

builder/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ if [[ ! -z $PUBLISH ]]; then
7575
PORT=${PORT:-2222}
7676
PROTO=${PROTO:-tcp}
7777

78+
set +e
79+
7880
# wait for the service to become available on PUBLISH port
7981
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
8082

cache/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ if [[ ! -z $PUBLISH ]]; then
6060
PORT=${PORT:-6379}
6161
PROTO=${PROTO:-tcp}
6262

63+
set +e
64+
6365
# wait for the service to become available on PUBLISH port
6466
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
6567

controller/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ if [[ ! -z $PUBLISH ]]; then
7777
PORT=${PORT:-8000}
7878
PROTO=${PROTO:-tcp}
7979

80+
set +e
81+
8082
# wait for the service to become available on PUBLISH port
8183
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
8284

database/bin/boot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ echo deis-database running...
7777
if [[ ! -z $PUBLISH ]]; then
7878

7979
# configure service discovery
80-
HOST=${HOST:-localhost}
8180
PORT=${PORT:-5432}
8281
PROTO=${PROTO:-tcp}
8382

83+
set +e
84+
8485
# wait for the service to become available on PUBLISH port
8586
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
8687

logger/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ if [[ ! -z $PUBLISH ]]; then
6262
PORT=${PORT:-514}
6363
PROTO=${PROTO:-tcp}
6464

65+
set +e
66+
6567
# wait for the service to become available on PUBLISH port
6668
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
6769

registry/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ if [[ ! -z $PUBLISH ]]; then
6868
PORT=${PORT:-5000}
6969
PROTO=${PROTO:-tcp}
7070

71+
set +e
72+
7173
# wait for the service to become available on PUBLISH port
7274
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
7375

router/bin/boot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ if [[ ! -z $PUBLISH ]]; then
6161
PORT=${PORT:-80}
6262
PROTO=${PROTO:-tcp}
6363

64+
set +e
65+
6466
# wait for the service to become available on PUBLISH port
6567
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PUBLISH\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
6668

0 commit comments

Comments
 (0)