You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-21 02:43:05 +03:00
Unset NOTIFY_SOCKET when running the temporary server. (#1325)
* Unset NOTIFY_SOCKET when running the temporary server. Postgres has native support for this notification socket and will write a `READY=1` message once it is ready and accepting connections. Unfortunately, the temporary server used by the `docker-entrypoint.sh` also sends a message on the socket, making it appear as though the container is ready and serving connections when it is not.
This commit is contained in:
3
13/alpine3.20/docker-entrypoint.sh
generated
3
13/alpine3.20/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
13/alpine3.21/docker-entrypoint.sh
generated
3
13/alpine3.21/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
13/bookworm/docker-entrypoint.sh
generated
3
13/bookworm/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
13/bullseye/docker-entrypoint.sh
generated
3
13/bullseye/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
14/alpine3.20/docker-entrypoint.sh
generated
3
14/alpine3.20/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
14/alpine3.21/docker-entrypoint.sh
generated
3
14/alpine3.21/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
14/bookworm/docker-entrypoint.sh
generated
3
14/bookworm/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
14/bullseye/docker-entrypoint.sh
generated
3
14/bullseye/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
15/alpine3.20/docker-entrypoint.sh
generated
3
15/alpine3.20/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
15/alpine3.21/docker-entrypoint.sh
generated
3
15/alpine3.21/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
15/bookworm/docker-entrypoint.sh
generated
3
15/bookworm/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
15/bullseye/docker-entrypoint.sh
generated
3
15/bullseye/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
16/alpine3.20/docker-entrypoint.sh
generated
3
16/alpine3.20/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
16/alpine3.21/docker-entrypoint.sh
generated
3
16/alpine3.21/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
16/bookworm/docker-entrypoint.sh
generated
3
16/bookworm/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
16/bullseye/docker-entrypoint.sh
generated
3
16/bullseye/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
17/alpine3.20/docker-entrypoint.sh
generated
3
17/alpine3.20/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
17/alpine3.21/docker-entrypoint.sh
generated
3
17/alpine3.21/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
17/bookworm/docker-entrypoint.sh
generated
3
17/bookworm/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
3
17/bullseye/docker-entrypoint.sh
generated
3
17/bullseye/docker-entrypoint.sh
generated
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
@ -269,6 +269,9 @@ docker_temp_server_start() {
|
|||||||
# does not listen on external TCP/IP and waits until start finishes
|
# does not listen on external TCP/IP and waits until start finishes
|
||||||
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}"
|
||||||
|
|
||||||
|
# unset NOTIFY_SOCKET so the temporary server doesn't prematurely notify
|
||||||
|
# any process supervisor.
|
||||||
|
NOTIFY_SOCKET= \
|
||||||
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
PGUSER="${PGUSER:-$POSTGRES_USER}" \
|
||||||
pg_ctl -D "$PGDATA" \
|
pg_ctl -D "$PGDATA" \
|
||||||
-o "$(printf '%q ' "$@")" \
|
-o "$(printf '%q ' "$@")" \
|
||||||
|
Reference in New Issue
Block a user