Hide Forgot
Description of problem: Upgrading from FC15 to FC16, postgres wouldn't start and mentioned we had to run: postgresql-setup upgrade However this failed and the log contained this: invalid old port number Failure, exiting Version-Release number of selected component (if applicable): postgresql-server-9.1.3-1.fc16.x86_64 postgresql-upgrade-9.1.3-1.fc16.x86_64 How reproducible: 100% Steps to Reproduce: 1. postgresql-setup upgrade 2. 3. Actual results: # postgresql-setup upgrade Redirecting to /bin/systemctl stop postgresql.service Upgrading database: failed See /var/lib/pgsql/pgupgrade.log for details. # cat /var/lib/pgsql/pgupgrade.log invalid old port number Failure, exiting Expected results: success Additional info: Inspection of /usr/bin/postgresql-setup shows it extracting the port from /lib/systemd/system/postgresql.service, but its extraction code isn't coping with the commented mention of the port in there as well. A quick fix is to modify this in /usr/bin/postgresql-setup: --- postgresql-setup.orig 2012-02-27 16:46:03.000000000 +0000 +++ postgresql-setup 2012-03-29 23:13:27.777872259 +0000 @@ -35,8 +35,8 @@ fi # Get port number and data directory from the service file -PGPORT=`sed -n 's/Environment=PGPORT=//p' "${SERVICE_FILE}"` -PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"` +PGPORT=`sed -n 's/^Environment=PGPORT=//p' "${SERVICE_FILE}"` +PGDATA=`sed -n 's/^Environment=PGDATA=//p' "${SERVICE_FILE}"`
This is dealt with already in 9.1.3-2 and later. *** This bug has been marked as a duplicate of bug 802835 ***