File tree 11 files changed +110
-11
lines changed 11 files changed +110
-11
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec su-exec postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec su-exec postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec su-exec postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec su-exec postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec su-exec postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
39
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
+ file_env ' POSTGRES_INITDB_ARGS'
47
+ export POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR "
48
+ fi
49
+
40
50
exec gosu postgres " $BASH_SOURCE " " $@ "
41
51
fi
42
52
@@ -47,7 +57,6 @@ if [ "$1" = 'postgres' ]; then
47
57
48
58
# look specifically for PG_VERSION, as it is expected in the DB dir
49
59
if [ ! -s " $PGDATA /PG_VERSION" ]; then
50
- file_env ' POSTGRES_INITDB_ARGS'
51
60
eval " initdb --username=postgres $POSTGRES_INITDB_ARGS "
52
61
53
62
# check password first so we can output the warning before postgres
You can’t perform that action at this time.
0 commit comments