diff --git a/bitnami/postgresql/13/debian-10/Dockerfile b/bitnami/postgresql/13/debian-10/Dockerfile index 3d73c39e14d1..7227970e6692 100644 --- a/bitnami/postgresql/13/debian-10/Dockerfile +++ b/bitnami/postgresql/13/debian-10/Dockerfile @@ -24,7 +24,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/postgresql/postunpack.sh RUN /opt/bitnami/scripts/locales/add-extra-locales.sh ENV BITNAMI_APP_NAME="postgresql" \ - BITNAMI_IMAGE_VERSION="13.0.0-debian-10-r37" \ + BITNAMI_IMAGE_VERSION="13.0.0-debian-10-r38" \ LANG="en_US.UTF-8" \ LANGUAGE="en_US:en" \ NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \ diff --git a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh index 33d2e50880e4..8e6faa3ca5b9 100644 --- a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -708,7 +708,7 @@ postgresql_custom_init_scripts() { # None ######################### postgresql_stop() { - local -r -a cmd=("pg_ctl" "stop" "-w" "-D" "$POSTGRESQL_DATA_DIR") + local -r -a cmd=("pg_ctl" "stop" "-w" "-D" "$POSTGRESQL_DATA_DIR" "-m" "$POSTGRESQL_SHUTDOWN_MODE" "-t" "$POSTGRESQL_PGCTLTIMEOUT") if [[ -f "$POSTGRESQL_PID_FILE" ]]; then info "Stopping PostgreSQL..." if am_i_root; then diff --git a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh index 99af7992f3e3..87b7547f5dce 100644 --- a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -20,6 +20,8 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" postgresql_env_vars=( POSTGRESQL_DATA_DIR POSTGRESQL_INIT_MAX_TIMEOUT + POSTGRESQL_PGCTLTIMEOUT + POSTGRESQL_SHUTDOWN_MODE POSTGRESQL_CLUSTER_APP_NAME POSTGRESQL_DATABASE POSTGRESQL_INITDB_ARGS @@ -79,6 +81,7 @@ postgresql_env_vars=( POSTGRESQL_POSTGRES_CONNECTION_LIMIT POSTGRES_DATA_DIR PGDATA + POSTGRES_SHUTDOWN_MODE POSTGRES_CLUSTER_APP_NAME POSTGRES_DATABASE POSTGRES_DB @@ -175,6 +178,9 @@ export POSTGRESQL_DAEMON_GROUP="postgres" # PostgreSQL settings export POSTGRESQL_INIT_MAX_TIMEOUT="${POSTGRESQL_INIT_MAX_TIMEOUT:-60}" +export POSTGRESQL_PGCTLTIMEOUT="${POSTGRESQL_PGCTLTIMEOUT:-60}" +POSTGRESQL_SHUTDOWN_MODE="${POSTGRESQL_SHUTDOWN_MODE:-"${POSTGRES_SHUTDOWN_MODE:-}"}" +export POSTGRESQL_SHUTDOWN_MODE="${POSTGRESQL_SHUTDOWN_MODE:-fast}" POSTGRESQL_CLUSTER_APP_NAME="${POSTGRESQL_CLUSTER_APP_NAME:-"${POSTGRES_CLUSTER_APP_NAME:-}"}" export POSTGRESQL_CLUSTER_APP_NAME="${POSTGRESQL_CLUSTER_APP_NAME:-walreceiver}" POSTGRESQL_DATABASE="${POSTGRESQL_DATABASE:-"${POSTGRES_DATABASE:-}"}" diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index 714a056eb535..fbb3e719f365 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -44,7 +44,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`13`, `13-debian-10`, `13.0.0`, `13.0.0-debian-10-r37` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/13.0.0-debian-10-r37/13/debian-10/Dockerfile) +* [`13`, `13-debian-10`, `13.0.0`, `13.0.0-debian-10-r38` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/13.0.0-debian-10-r38/13/debian-10/Dockerfile) * [`12`, `12-debian-10`, `12.4.0`, `12.4.0-debian-10-r89` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/12.4.0-debian-10-r89/12/debian-10/Dockerfile) * [`11`, `11-debian-10`, `11.9.0`, `11.9.0-debian-10-r75`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.9.0-debian-10-r75/11/debian-10/Dockerfile) * [`10`, `10-debian-10`, `10.14.0`, `10.14.0-debian-10-r89` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.14.0-debian-10-r89/10/debian-10/Dockerfile) @@ -652,6 +652,13 @@ services: ... ``` +## Stopping settings + +You can control the parameters used to stop postgresql in the initialization process by using: + + - `POSTGRESQL_PGCTLTIMEOUT` that will set the timeout for the `pg_ctl` command. + - `POSTGRESQL_SHUTDOWN_MODE` that will indicate the [shutdown mode](https://www.postgresql.org/docs/11/app-pg-ctl.html) used. + ## Environment variables aliases The Bitnami PostgreSQL container allows two different sets of environment variables. Please see the list of environment variable aliases in the next table: @@ -677,6 +684,7 @@ The Bitnami PostgreSQL container allows two different sets of environment variab | POSTGRESQL_MASTER_PORT_NUMBER | POSTGRES_MASTER_PORT_NUMBER | | POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS | POSTGRES_NUM_SYNCHRONOUS_REPLICAS | | POSTGRESQL_SYNCHRONOUS_COMMIT_MODE | POSTGRES_SYNCHRONOUS_COMMIT_MODE | +| POSTGRESQL_SHUTDOWN_MODE | POSTGRES_SHUTDOWN_MODE | > *IMPORTANT*: Changing the `POSTGRES_USER` will not change the owner of the database that will continue being the `postgres` user. In order to change the database owner, please access using `postgres` as user (`$ psql -U postgres ...`) and execute the following command: ```console