File tree Expand file tree Collapse file tree 11 files changed +99
-0
lines changed
Expand file tree Collapse file tree 11 files changed +99
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec su-exec postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec gosu postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec su-exec postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec gosu postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec su-exec postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec gosu postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec su-exec postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec gosu postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec su-exec postgres " $BASH_SOURCE " " $@ "
4150fi
4251
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ 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+ file_env ' POSTGRES_INITDB_XLOGDIR'
42+ if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
43+ mkdir -p " $POSTGRES_INITDB_XLOGDIR "
44+ chmod 700 " $POSTGRES_INITDB_XLOGDIR "
45+ chown -R postgres " $POSTGRES_INITDB_XLOGDIR "
46+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
47+ fi
48+
4049 exec gosu postgres " $BASH_SOURCE " " $@ "
4150fi
4251
You can’t perform that action at this time.
0 commit comments