From 36ffea2cb2242bb5be69f51e7a42f3bd810f2680 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 28 Dec 2020 09:51:28 -0800 Subject: [PATCH] Adjust "chmod" to not fail (since PostgreSQL validates this itself later) --- 10/alpine/docker-entrypoint.sh | 3 ++- 10/docker-entrypoint.sh | 3 ++- 11/alpine/docker-entrypoint.sh | 3 ++- 11/docker-entrypoint.sh | 3 ++- 12/alpine/docker-entrypoint.sh | 3 ++- 12/docker-entrypoint.sh | 3 ++- 13/alpine/docker-entrypoint.sh | 3 ++- 13/docker-entrypoint.sh | 3 ++- 9.5/alpine/docker-entrypoint.sh | 3 ++- 9.5/docker-entrypoint.sh | 3 ++- 9.6/alpine/docker-entrypoint.sh | 3 ++- 9.6/docker-entrypoint.sh | 3 ++- docker-entrypoint.sh | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) diff --git a/10/alpine/docker-entrypoint.sh b/10/alpine/docker-entrypoint.sh index 72cdc53d65..d95a37fb3a 100755 --- a/10/alpine/docker-entrypoint.sh +++ b/10/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/10/docker-entrypoint.sh b/10/docker-entrypoint.sh index 51d871b717..69155541bb 100755 --- a/10/docker-entrypoint.sh +++ b/10/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/11/alpine/docker-entrypoint.sh b/11/alpine/docker-entrypoint.sh index 72cdc53d65..d95a37fb3a 100755 --- a/11/alpine/docker-entrypoint.sh +++ b/11/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/11/docker-entrypoint.sh b/11/docker-entrypoint.sh index 51d871b717..69155541bb 100755 --- a/11/docker-entrypoint.sh +++ b/11/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/12/alpine/docker-entrypoint.sh b/12/alpine/docker-entrypoint.sh index 72cdc53d65..d95a37fb3a 100755 --- a/12/alpine/docker-entrypoint.sh +++ b/12/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/12/docker-entrypoint.sh b/12/docker-entrypoint.sh index 51d871b717..69155541bb 100755 --- a/12/docker-entrypoint.sh +++ b/12/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/13/alpine/docker-entrypoint.sh b/13/alpine/docker-entrypoint.sh index 72cdc53d65..d95a37fb3a 100755 --- a/13/alpine/docker-entrypoint.sh +++ b/13/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/13/docker-entrypoint.sh b/13/docker-entrypoint.sh index 51d871b717..69155541bb 100755 --- a/13/docker-entrypoint.sh +++ b/13/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/9.5/alpine/docker-entrypoint.sh b/9.5/alpine/docker-entrypoint.sh index 0e0e2e914b..7c82faea26 100755 --- a/9.5/alpine/docker-entrypoint.sh +++ b/9.5/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index 49374701a6..ed16fa48b1 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/9.6/alpine/docker-entrypoint.sh b/9.6/alpine/docker-entrypoint.sh index 0e0e2e914b..7c82faea26 100755 --- a/9.6/alpine/docker-entrypoint.sh +++ b/9.6/alpine/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/9.6/docker-entrypoint.sh b/9.6/docker-entrypoint.sh index 49374701a6..ed16fa48b1 100755 --- a/9.6/docker-entrypoint.sh +++ b/9.6/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || : diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 51d871b717..69155541bb 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -37,7 +37,8 @@ docker_create_db_directories() { local user; user="$(id -u)" mkdir -p "$PGDATA" - chmod 700 "$PGDATA" + # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) + chmod 700 "$PGDATA" || : # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 mkdir -p /var/run/postgresql || :