File tree Expand file tree Collapse file tree 11 files changed +110
-0
lines changed
Expand file tree Collapse file tree 11 files changed +110
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec su-exec postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec gosu postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec su-exec postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec gosu postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec su-exec postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec gosu postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec su-exec postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec gosu postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec su-exec postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3737 chown -R postgres /var/run/postgresql
3838 chmod g+s /var/run/postgresql
3939
40+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
41+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
42+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
43+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ fi
46+
4047 exec gosu postgres " $BASH_SOURCE " " $@ "
4148fi
4249
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
4855 # look specifically for PG_VERSION, as it is expected in the DB dir
4956 if [ ! -s " $PGDATA /PG_VERSION" ]; then
5057 file_env ' POSTGRES_INITDB_ARGS'
58+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
59+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
60+ fi
5161 eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
5262
5363 # check password first so we can output the warning before postgres
You can’t perform that action at this time.
0 commit comments