1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-17 13:02:40 +03:00

Merge pull request #964 from fjf2002/patch-1

prep for possible `set -u` in docker-entrypoint.sh
This commit is contained in:
Tianon Gravi
2022-06-16 15:55:41 -07:00
committed by GitHub
15 changed files with 30 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi

View File

@@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || : chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user # Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR" mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@@ -84,7 +84,7 @@ docker_init_database_dir() {
done done
fi fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi fi