From e616341507a7beec3a161b0a366ba0d3400328fd Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Mon, 9 Mar 2015 13:03:14 -0700 Subject: [PATCH] Ensure /run/postgresql has correct ownership Fixes #50 --- 8.4/docker-entrypoint.sh | 3 +++ 9.0/docker-entrypoint.sh | 3 +++ 9.1/docker-entrypoint.sh | 3 +++ 9.2/docker-entrypoint.sh | 3 +++ 9.3/docker-entrypoint.sh | 3 +++ 9.4/docker-entrypoint.sh | 3 +++ docker-entrypoint.sh | 3 +++ 7 files changed, 21 insertions(+) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6d546b4816..27c98d2147 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,6 +4,9 @@ set -e if [ "$1" = 'postgres' ]; then chown -R postgres "$PGDATA" + chmod g+s /run/postgresql + chown -R postgres:postgres /run/postgresql + if [ -z "$(ls -A "$PGDATA")" ]; then gosu postgres initdb