Skip to content

Commit 888bd47

Browse files
committed
feat: make sure old pg stops if not force stop
1 parent b81245b commit 888bd47

File tree

1 file changed

+7
-0
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+7
-0
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

+7
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,13 @@ EOF
478478

479479
sleep 3
480480
systemctl stop postgresql
481+
482+
# Additional check to ensure postgres is really stopped
483+
if [ -f "${PGDATAOLD}/postmaster.pid" ]; then
484+
echo "PostgreSQL still running, forcing stop..."
485+
kill -9 $(head -n 1 "${PGDATAOLD}/postmaster.pid") || true
486+
rm -f "${PGDATAOLD}/postmaster.pid"
487+
fi
481488
else
482489
CI_stop_postgres
483490
fi

0 commit comments

Comments
 (0)