File tree Expand file tree Collapse file tree 9 files changed +11
-11
lines changed Expand file tree Collapse file tree 9 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,4 @@ SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pi
120120Then promote the replica. There are two options:
121121- Create the ` promote.signal ` in the data directory ` touch /var/lib/postgresql/data/promote.signal ` on the replica.
122122 If you've changed your configuration, make sure ` promote_trigger_file ` declares that path.
123- - Execute ` su-exec postgres pg_ctl promote` in the container.
123+ - Execute ` gosu postgres pg_ctl promote` in the container.
Original file line number Diff line number Diff line change 11#! /bin/bash
22if [ " $( id -u) " == " 1000" ]; then exec wal-g backup-push " $PGDATA " --config=" $WALG_CONFIG_FILE " ; fi
3- exec su-exec postgres wal-g backup-push " $PGDATA " --config=" $WALG_CONFIG_FILE "
3+ exec gosu postgres wal-g backup-push " $PGDATA " --config=" $WALG_CONFIG_FILE "
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if [ "$first" == "psql" ] || [ "$first" == "postgres" ] || [ "$first" == "pg_ctl
1414 if [ " $first " == " postgres" ] && [ ! -s " $PGDATA /PG_VERSION" ]; then /scripts/initdb; fi
1515
1616 [ " $( id -u) " == " 1000" ] && exec " $@ "
17- exec su-exec postgres " $@ "
17+ exec gosu postgres " $@ "
1818fi
1919
2020exec " $@ "
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -Eeo pipefail
3- if [ " $( id -u) " != " 1000" ] ; then exec su-exec postgres " $BASH_SOURCE " " $@ " ; fi
3+ if [ " $( id -u) " != " 1000" ] ; then exec gosu postgres " $BASH_SOURCE " " $@ " ; fi
44
55source /usr/local/bin/docker-entrypoint.sh
66
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -Eeo pipefail
3- if [ " $( id -u) " != " 1000" ] ; then exec su-exec postgres " $BASH_SOURCE " " $@ " ; fi
3+ if [ " $( id -u) " != " 1000" ] ; then exec gosu postgres " $BASH_SOURCE " " $@ " ; fi
44
55TRUST=$1
66if [ " $TRUST " == " " ] && [ " $POSTGRES_HOST_AUTH_METHOD " != " " ]; then TRUST=$POSTGRES_HOST_AUTH_METHOD ; fi
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -Eeo pipefail
3- if [ " $( id -u) " != " 1000" ] ; then exec su-exec postgres " $BASH_SOURCE " " $@ " ; fi
3+ if [ " $( id -u) " != " 1000" ] ; then exec gosu postgres " $BASH_SOURCE " " $@ " ; fi
44source /usr/local/bin/docker-entrypoint.sh
55
66# When recovering, the database directory must be empty
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -Eeo pipefail
3- if [ " $( id -u) " != " 1000" ] ; then exec su-exec postgres " $BASH_SOURCE " " $@ " ; fi
3+ if [ " $( id -u) " != " 1000" ] ; then exec gosu postgres " $BASH_SOURCE " " $@ " ; fi
44
55if [ -s " $PGDATA /PG_VERSION" ]; then exec postgres; fi
66/scripts/recover -R " $@ "
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -Eeo pipefail
3- if [ " $( id -u) " != " 1000" ] ; then exec su-exec postgres " $BASH_SOURCE " " $@ " ; fi
3+ if [ " $( id -u) " != " 1000" ] ; then exec gosu postgres " $BASH_SOURCE " " $@ " ; fi
44
55# Set the default socket directory to /var/run/postgresql or $PGHOST
66sed -i " s?.*unix_socket_directories =.*?unix_socket_directories = '$PGHOST '?g" $PGDATA /postgresql.conf
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ if [ -d "$PGDATANEW" ]; then
5959fi
6060
6161if [ " $( id -u) " != " 1000" ] ; then
62- PGDATA=" $PGDATANEW " su-exec postgres:postgres $PGBINNEW /initdb
63- PGDATA=" $PGDATANEW " su-exec postgres:postgres /scripts/tuneconfig
64- su-exec postgres:postgres pg_upgrade --link -j $( getconf _NPROCESSORS_ONLN)
62+ PGDATA=" $PGDATANEW " gosu postgres:postgres $PGBINNEW /initdb
63+ PGDATA=" $PGDATANEW " gosu postgres:postgres /scripts/tuneconfig
64+ gosu postgres:postgres pg_upgrade --link -j $( getconf _NPROCESSORS_ONLN)
6565else
6666 PGDATA=" $PGDATANEW " $PGBINNEW /initdb
6767 PGDATA=" $PGDATANEW " /scripts/tuneconfig
You can’t perform that action at this time.
0 commit comments