From 33bccfcaddd0679f55ee1028c012d26cd196537d Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 27 Feb 2020 13:59:55 -0800 Subject: [PATCH] Fix silently skipped init scripts --- 10/alpine/docker-entrypoint.sh | 4 ++++ 10/docker-entrypoint.sh | 4 ++++ 11/alpine/docker-entrypoint.sh | 4 ++++ 11/docker-entrypoint.sh | 4 ++++ 12/alpine/docker-entrypoint.sh | 4 ++++ 12/docker-entrypoint.sh | 4 ++++ 9.5/alpine/docker-entrypoint.sh | 4 ++++ 9.5/docker-entrypoint.sh | 4 ++++ 9.6/alpine/docker-entrypoint.sh | 4 ++++ 9.6/docker-entrypoint.sh | 4 ++++ docker-entrypoint.sh | 4 ++++ 11 files changed, 44 insertions(+) diff --git a/10/alpine/docker-entrypoint.sh b/10/alpine/docker-entrypoint.sh index 78adac6212..e761e26cbc 100755 --- a/10/alpine/docker-entrypoint.sh +++ b/10/alpine/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/10/docker-entrypoint.sh b/10/docker-entrypoint.sh index a9190b4055..cd8ce805a4 100755 --- a/10/docker-entrypoint.sh +++ b/10/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/11/alpine/docker-entrypoint.sh b/11/alpine/docker-entrypoint.sh index 78adac6212..e761e26cbc 100755 --- a/11/alpine/docker-entrypoint.sh +++ b/11/alpine/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/11/docker-entrypoint.sh b/11/docker-entrypoint.sh index a9190b4055..cd8ce805a4 100755 --- a/11/docker-entrypoint.sh +++ b/11/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/12/alpine/docker-entrypoint.sh b/12/alpine/docker-entrypoint.sh index 78adac6212..e761e26cbc 100755 --- a/12/alpine/docker-entrypoint.sh +++ b/12/alpine/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/12/docker-entrypoint.sh b/12/docker-entrypoint.sh index a9190b4055..cd8ce805a4 100755 --- a/12/docker-entrypoint.sh +++ b/12/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/9.5/alpine/docker-entrypoint.sh b/9.5/alpine/docker-entrypoint.sh index f87b08bdfe..aad5d4de76 100755 --- a/9.5/alpine/docker-entrypoint.sh +++ b/9.5/alpine/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index 84eb98d6f1..1ba1cfc8f7 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/9.6/alpine/docker-entrypoint.sh b/9.6/alpine/docker-entrypoint.sh index f87b08bdfe..aad5d4de76 100755 --- a/9.6/alpine/docker-entrypoint.sh +++ b/9.6/alpine/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/9.6/docker-entrypoint.sh b/9.6/docker-entrypoint.sh index 84eb98d6f1..1ba1cfc8f7 100755 --- a/9.6/docker-entrypoint.sh +++ b/9.6/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a9190b4055..cd8ce805a4 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -284,6 +284,10 @@ _main() { # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + docker_init_database_dir pg_setup_hba_conf