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 85d3dc4390aba..293c41befac37 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 @@ -848,6 +848,11 @@ repmgr_initialize() { ensure_dir_exists "$POSTGRESQL_DATA_DIR" am_i_root && chown "$POSTGRESQL_DAEMON_USER:$POSTGRESQL_DAEMON_GROUP" "$POSTGRESQL_DATA_DIR" + # remove old pid file if it exists + if [[ -f "/tmp/repmgr.pid" ]]; then + rm /tmp/repmgr.pid + fi + if [[ "$REPMGR_ROLE" = "standby" ]]; then repmgr_wait_primary_node || exit 1 repmgr_rewind