Merge pull request #964 from fjf2002/patch-1
prep for possible `set -u` in docker-entrypoint.sh
This commit is contained in:
commit
b979def1c4
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue