diff --git a/bitnami/postgresql-repmgr/17/debian-12/Dockerfile b/bitnami/postgresql-repmgr/17/debian-12/Dockerfile index 5e264fdfed18..f8ced5f396bd 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/Dockerfile +++ b/bitnami/postgresql-repmgr/17/debian-12/Dockerfile @@ -8,7 +8,7 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2025-07-01T11:14:50Z" \ + org.opencontainers.image.created="2025-07-09T07:55:20Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr/README.md" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr" \ diff --git a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/librepmgr.sh b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/librepmgr.sh index 4fafdade5674..dc0f9232d178 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/librepmgr.sh +++ b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/librepmgr.sh @@ -547,6 +547,7 @@ async_query_timeout='${REPMGR_MASTER_RESPONSE_TIMEOUT}' primary_visibility_consensus=${REPMGR_PRIMARY_VISIBILITY_CONSENSUS} pg_ctl_options='-o "--config-file=\"${POSTGRESQL_CONF_FILE}\" --external_pid_file=\"${POSTGRESQL_PID_FILE}\" --hba_file=\"${POSTGRESQL_PGHBA_FILE}\""' pg_basebackup_options='$waldir_option' +repmgrd_pid_file='${REPMGR_PID_FILE}' EOF if is_boolean_yes "$REPMGR_FENCE_OLD_PRIMARY"; then @@ -855,6 +856,10 @@ repmgr_initialize() { ensure_dir_exists "$POSTGRESQL_DATA_DIR" am_i_root && chown "$POSTGRESQL_DAEMON_USER:$POSTGRESQL_DAEMON_GROUP" "$POSTGRESQL_DATA_DIR" + # This fixes an issue where the trap would kill the entrypoint.sh, if a PID was left over from a previous run + # Exec replaces the process without creating a new one, and when the container is restarted it may have the same PID + rm -f "$REPMGR_PID_FILE" + if [[ "$REPMGR_ROLE" = "standby" ]]; then repmgr_wait_primary_node || exit 1 repmgr_rewind diff --git a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh index ca152e0fa30c..7825c08fcdb8 100644 --- a/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql-repmgr/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -428,6 +428,7 @@ export REPMGR_STANDBY_ROLE_LOCK_FILE_NAME="$REPMGR_LOCK_DIR/standby.lock" export REPMGR_BIN_DIR="$REPMGR_BASE_DIR/bin" export REPMGR_CONF_FILE="$REPMGR_CONF_DIR/repmgr.conf" export REPMGR_DATA_DIR="${REPMGR_DATA_DIR:-${REPMGR_VOLUME_DIR}/repmgr/data}" +export REPMGR_PID_FILE="${REPMGR_TMP_DIR}/repmgr.pid" # Settings (Replication Manager) export REPMGR_NODE_ID="${REPMGR_NODE_ID:-}" diff --git a/bitnami/postgresql-repmgr/17/debian-12/tags-info.yaml b/bitnami/postgresql-repmgr/17/debian-12/tags-info.yaml deleted file mode 100644 index 96cf8d1a4fb9..000000000000 --- a/bitnami/postgresql-repmgr/17/debian-12/tags-info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -rolling-tags: - - "17" - - 17-debian-12 - - 17.5.0 - - latest diff --git a/bitnami/postgresql-repmgr/README.md b/bitnami/postgresql-repmgr/README.md index 76a9db5cbb1b..5796af519068 100644 --- a/bitnami/postgresql-repmgr/README.md +++ b/bitnami/postgresql-repmgr/README.md @@ -709,6 +709,7 @@ Refer to [issues/27124](https://github.com/bitnami/containers/issues/27124) for | `REPMGR_STANDBY_ROLE_LOCK_FILE_NAME` | Replication Manager lock file for the standby node | `$REPMGR_LOCK_DIR/standby.lock` | | `REPMGR_BIN_DIR` | Replication Manager executables directory | `$REPMGR_BASE_DIR/bin` | | `REPMGR_CONF_FILE` | Replication Manager configuration file | `$REPMGR_CONF_DIR/repmgr.conf` | +| `REPMGR_PID_FILE` | Replication Manager PID file. | `${REPMGR_TMP_DIR}/repmgr.pid` | | `REPMGR_CURRENT_PRIMARY_PORT` | Current primary host port | `$REPMGR_PRIMARY_PORT` | | `POSTGRESQL_REPLICATION_USER` | PostgreSQL replication user | `$REPMGR_USERNAME` | | `POSTGRESQL_REPLICATION_PASSWORD` | Password for the PostgreSQL replication user | `$REPMGR_PASSWORD` |