Skip to content

Commit

Permalink
fix(database): initdb if not already initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Monroy committed Oct 18, 2014
1 parent d40b1b3 commit 702e9a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions database/bin/boot
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ until confd -onetime -node $ETCD -config-file /app/confd.toml; do
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
done

# initialize database if one doesn't already exist
# for example, in the case of a data container
if [[ ! -d /var/lib/postgresql/9.3/main ]]; then
sudo -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /var/lib/postgresql/9.3/main --locale=en_US.UTF-8
chown -R postgres:postgres /var/lib/postgresql
fi

# ensure WAL log bucket exists
envdir /etc/wal-e.d/env /app/bin/create_bucket ${BUCKET_NAME}

Expand Down

0 comments on commit 702e9a7

Please sign in to comment.