File tree Expand file tree Collapse file tree 11 files changed +87
-10
lines changed Expand file tree Collapse file tree 11 files changed +87
-10
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
-
40
- exec su-exec postgres " $BASH_SOURCE " " $@ "
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
46
+
47
+ exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
42
49
43
50
if [ " $1 " = ' postgres' ]; then
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
-
40
- exec su-exec postgres " $BASH_SOURCE " " $@ "
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
46
+
47
+ exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
42
49
43
50
if [ " $1 " = ' postgres' ]; then
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
-
40
- exec su-exec postgres " $BASH_SOURCE " " $@ "
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
46
+
47
+ exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
42
49
43
50
if [ " $1 " = ' postgres' ]; then
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
-
40
- exec su-exec postgres " $BASH_SOURCE " " $@ "
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
46
+
47
+ exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
42
49
43
50
if [ " $1 " = ' postgres' ]; then
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
-
40
- exec su-exec postgres " $BASH_SOURCE " " $@ "
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
46
+
47
+ exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
42
49
43
50
if [ " $1 " = ' postgres' ]; then
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
36
36
mkdir -p /var/run/postgresql
37
37
chown -R postgres /var/run/postgresql
38
38
chmod g+s /var/run/postgresql
39
+ # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
40
+ if [ " $POSTGRES_XLOG_DIR " ]; then
41
+ mkdir -p " $POSTGRES_XLOG_DIR "
42
+ chmod 700 " $POSTGRES_XLOG_DIR "
43
+ chown -R postgres " $POSTGRES_XLOG_DIR "
44
+ POSTGRES_INITDB_ARGS=" $POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_XLOG_DIR "
45
+ fi
39
46
40
47
exec gosu postgres " $BASH_SOURCE " " $@ "
41
48
fi
You can’t perform that action at this time.
0 commit comments