File tree 13 files changed +130
-78
lines changed
13 files changed +130
-78
lines changed Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
Original file line number Diff line number Diff line change 30
30
31
31
# allow the container to be started with `--user`
32
32
if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
33
- mkdir -p " $PGDATA "
34
- chown -R postgres " $PGDATA "
35
- chmod 700 " $PGDATA "
33
+ if mountpoint $PGDATA ; then
34
+ mkdir -p " $PGDATA "
35
+ chown -R postgres " $PGDATA "
36
+ chmod 700 " $PGDATA "
37
+ fi
36
38
37
39
mkdir -p /var/run/postgresql
38
40
chown -R postgres /var/run/postgresql
@@ -49,9 +51,11 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
49
51
fi
50
52
51
53
if [ " $1 " = ' postgres' ]; then
52
- mkdir -p " $PGDATA "
53
- chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54
- chmod 700 " $PGDATA " 2> /dev/null || :
54
+ if mountpoint $PGDATA ; then
55
+ mkdir -p " $PGDATA "
56
+ chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
57
+ chmod 700 " $PGDATA " 2> /dev/null || :
58
+ fi
55
59
56
60
# look specifically for PG_VERSION, as it is expected in the DB dir
57
61
if [ ! -s " $PGDATA /PG_VERSION" ]; then
You can’t perform that action at this time.
0 commit comments