1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-07-26 23:21:10 +03:00

prep for possible set -u in docker-entrypoint.sh

Update docker-entrypoint.sh
This commit is contained in:
fjf2002
2022-05-31 11:24:05 +02:00
committed by Joe Ferguson
parent 3eaa83fe3e
commit 74e51d102a
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