Skip to content

Commit

Permalink
chore(journal): suppress etcdctl output, add other clarifying output
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Monroy authored and Matthew Fisher committed Apr 15, 2014
1 parent 7e9b418 commit 6aa0092
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 22 deletions.
4 changes: 3 additions & 1 deletion builder/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
echo "waiting for confd to write initial templates..."
echo "builder: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

Expand Down Expand Up @@ -65,6 +65,8 @@ function on_exit() {
}
trap on_exit INT TERM EXIT

echo deis-builder running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
4 changes: 3 additions & 1 deletion cache/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
echo "waiting for confd to write initial templates..."
echo "cache: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

Expand All @@ -50,6 +50,8 @@ trap on_exit INT TERM
confd -node $ETCD -config-file /app/confd.toml &
CONFD_PID=$!

echo deis-cache running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
14 changes: 8 additions & 6 deletions controller/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ done
sleep $(($ETCD_TTL+1))

# seed initial service configuration if necessary
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>/dev/null; then
etcdctl -C $ETCD set $ETCD_PATH/protocol ${DEIS_PROTOCOL:-http}
etcdctl -C $ETCD set $ETCD_PATH/secretKey ${DEIS_SECRET_KEY:-`openssl rand -base64 64 | tr -d '\n'`}
etcdctl -C $ETCD set $ETCD_PATH/builderKey ${DEIS_BUILDER_KEY:-`openssl rand -base64 64 | tr -d '\n'`}
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>&1; then
etcdctl -C $ETCD set $ETCD_PATH/protocol ${DEIS_PROTOCOL:-http} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/secretKey ${DEIS_SECRET_KEY:-`openssl rand -base64 64 | tr -d '\n'`} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/builderKey ${DEIS_BUILDER_KEY:-`openssl rand -base64 64 | tr -d '\n'`} >/dev/null
fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml 2>/dev/null; do
echo "waiting for confd to write initial templates..."
echo "controller: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

# wait for confd to populate all values
while grep -q '<no value>' /templates/confd_settings.py; do
echo "waiting for confd to write all values..."
echo "controller: waiting for confd to write all values..."
confd -onetime -node $ETCD -config-file /app/confd.toml 2>/dev/null
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done
Expand Down Expand Up @@ -67,6 +67,8 @@ trap on_exit INT TERM
confd -node $ETCD -config-file /app/confd.toml &
CONFD_PID=$!

echo deis-controller running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
16 changes: 9 additions & 7 deletions database/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ done
sleep $(($ETCD_TTL+1))

# seed initial service configuration if necessary
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>/dev/null; then
etcdctl -C $ETCD set $ETCD_PATH/engine postgresql_psycopg2
etcdctl -C $ETCD set $ETCD_PATH/adminUser ${PG_ADMIN_USER:-postgres}
etcdctl -C $ETCD set $ETCD_PATH/adminPass ${PG_ADMIN_PASS:-changeme123}
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>&1; then
etcdctl -C $ETCD set $ETCD_PATH/engine postgresql_psycopg2 >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/adminUser ${PG_ADMIN_USER:-postgres} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/adminPass ${PG_ADMIN_PASS:-changeme123} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/user ${PG_USER_NAME:-deis} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/password ${PG_USER_PASS:-changeme123}
etcdctl -C $ETCD set $ETCD_PATH/name ${PG_USER_DB:-deis}
etcdctl -C $ETCD set $ETCD_PATH/password ${PG_USER_PASS:-changeme123} >/dev/null
etcdctl -C $ETCD set $ETCD_PATH/name ${PG_USER_DB:-deis} >/dev/null
fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
echo "waiting for confd to write initial templates..."
echo "database: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

Expand Down Expand Up @@ -70,6 +70,8 @@ sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".5432\
# perform a one-time reload to populate database entries
/usr/local/bin/reload

echo deis-database running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
8 changes: 5 additions & 3 deletions logger/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ done
sleep $(($ETCD_TTL+1))

# seed initial service configuration if necessary
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>/dev/null; then
if ! etcdctl -C $ETCD ls $ETCD_PATH >/dev/null 2>&1; then
etcdctl -C $ETCD mkdir $ETCD_PATH >/dev/null 2>&1 || true
fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
echo "waiting for confd to write initial templates..."
echo "logger: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

# cleanup old pidfile's
rm -f /var/run/rsyslog.pid
test -e /var/run/rsyslog.pid && rm -f /var/run/rsyslog.pid

# spawn the service in the background
/usr/sbin/rsyslogd -n &
Expand All @@ -52,6 +52,8 @@ trap on_exit INT TERM
confd -node $ETCD -config-file /app/confd.toml &
CONFD_PID=$!

echo deis-logger running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
4 changes: 3 additions & 1 deletion registry/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
echo "waiting for confd to write initial templates..."
echo "registry: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

Expand All @@ -55,6 +55,8 @@ trap on_exit INT TERM
confd -node $ETCD -config-file /app/confd.toml &
CONFD_PID=$!

echo deis-registry running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down
8 changes: 5 additions & 3 deletions router/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ sleep $(($ETCD_TTL+1))

# seed initial service configuration if necessary
if ! etcdctl -C $ETCD ls /deis/services >/dev/null 2>&1; then
etcdctl -C $ETCD mkdir /deis/services || true 2>/dev/null
etcdctl -C $ETCD set $ETCD_PATH/port ${PORT:-80}
etcdctl -C $ETCD mkdir /deis/services || true >/dev/null 2>&1
etcdctl -C $ETCD set $ETCD_PATH/port ${PORT:-80} >/dev/null
fi

# wait for confd to run once and install initial templates
until confd -onetime -node $ETCD -config-file /app/confd.toml >/dev/null 2>/dev/null; do
echo "waiting for confd to write initial templates..."
echo "router: waiting for confd to write initial templates..."
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

Expand All @@ -51,6 +51,8 @@ trap on_exit INT TERM
confd -node $ETCD -config-file /app/confd.toml &
CONFD_PID=$!

echo deis-router running...

# publish the service to etcd using the injected HOST and PORT
if [[ ! -z $PUBLISH ]]; then

Expand Down

0 comments on commit 6aa0092

Please sign in to comment.