Check that vol actually contains DB files, as opposed to a non-empty dir.
Referencing file list here: http://www.postgresql.org/docs/9.1/static/storage-file-layout.html
This commit is contained in:
parent
403dc53653
commit
3231f4a4d8
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
chmod g+s /run/postgresql
|
||||
chown -R postgres:postgres /run/postgresql
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
# check password first so we can ouptut the warning before postgres
|
||||
# check password first so we can output the warning before postgres
|
||||
# messes it up
|
||||
if [ "$POSTGRES_PASSWORD" ]; then
|
||||
pass="PASSWORD '$POSTGRES_PASSWORD'"
|
||||
|
|
|
|||
Loading…
Reference in New Issue