1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-04-18 00:57:36 +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:
Paul Liétar 2025-02-27 00:53:12 +00:00 committed by GitHub
parent 729d22b104
commit cc254e85ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 63 additions and 0 deletions

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \

View File

@ -269,6 +269,9 @@ docker_temp_server_start() {
# does not listen on external TCP/IP and waits until start finishes
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}" \
pg_ctl -D "$PGDATA" \
-o "$(printf '%q ' "$@")" \