Bug 264097

Summary: databases/postgresql1{2,3,4}-server: missing expansion of data%%PG_VERSION%% in startup script
Product: Ports & Packages Reporter: Marek Zarychta <zarychtam>
Component: Individual Port(s)Assignee: Palle Girgensohn <girgen>
Status: Closed FIXED    
Severity: Affects Some People CC: ale_sagra, alexander, girgen, leres, olivierw1+bugzilla-freebsd, se, vidar
Priority: --- Keywords: regression
Version: LatestFlags: bugzilla: maintainer-feedback? (pgsql)
Hardware: Any   
OS: Any   

Description Marek Zarychta 2022-05-20 09:59:15 UTC
After upgrade to postgresql14-server-14.3 with the help of ports-mgmt/portmaster (portmaster-3.21) the server is not able to start due to breakage in installed /usr/local/etc/rc.d/postgresql script. The startup script instead of postgresql_data="/var/db/postgres/data14" contains unexpanded "/var/db/postgres/data%%PG_VERSION%%". Using the script from postgresql14-server-14.2 fixes the issue.
Comment 1 Alessandro Sagratini 2022-05-21 12:08:04 UTC
Same happens after upgrading postgresql 13
Comment 2 Alexander Ushakov 2022-05-22 15:28:06 UTC
Same problem after postgresql 12 upgrade with portmaster
Comment 3 Marek Zarychta 2022-05-22 20:11:05 UTC
It looks like a breakage in ports-mgmt/portmaster.
Comment 4 Stefan Eßer freebsd_committer freebsd_triage 2022-05-22 20:44:12 UTC
(In reply to Marek Zarychta from comment #3)

> It looks like a breakage in ports-mgmt/portmaster.
No, this does not look like a breakage in portmaster!

Did you test building the postgresql-server port without portmaster?

Building with a plain "make" in the port's directory causes the same issue, even on a system that does not have portmaster installed.

This might be due to the changes required when postgresql-15 support has been introduced, but I did not have time to check why this is broken now, when it used to work before.

Please open a PR against the postgresql port.
Comment 5 Palle Girgensohn freebsd_committer freebsd_triage 2022-05-23 10:28:39 UTC
this is a postgresql issue, as ius also now stated in the summary.
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-05-23 10:47:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9230d75a823cc4191f4ad358422762b175e91ccd

commit 9230d75a823cc4191f4ad358422762b175e91ccd
Author:     Palle Girgensohn <girgen@FreeBSD.org>
AuthorDate: 2022-05-23 10:43:37 +0000
Commit:     Palle Girgensohn <girgen@FreeBSD.org>
CommitDate: 2022-05-23 10:46:14 +0000

    postgresql??-server: fix regression in the rc script

    The rc script was converted to use a SUB_LIST variable, but I failed to
    introduce the variable correctly in the Makefile. [1]

    The plist for postgresql15-server was incorrect. Fixed this as well.

    PR:     264097 [1]

 databases/postgresql10-server/Makefile            |  2 +-
 databases/postgresql11-server/Makefile            |  2 +-
 databases/postgresql12-server/Makefile            |  2 +-
 databases/postgresql13-server/Makefile            |  2 +-
 databases/postgresql14-server/Makefile            |  2 +-
 databases/postgresql15-server/Makefile            |  5 +-
 databases/postgresql15-server/files/postgresql.in |  4 +-
 databases/postgresql15-server/pkg-plist-server    | 84 +++++++++++++++++++++--
 8 files changed, 90 insertions(+), 13 deletions(-)
Comment 7 Palle Girgensohn freebsd_committer freebsd_triage 2022-05-23 10:48:02 UTC
Fix commited. Thanks for the report!
Comment 8 Palle Girgensohn freebsd_committer freebsd_triage 2022-05-24 07:04:35 UTC
*** Bug 264161 has been marked as a duplicate of this bug. ***
Comment 9 Marek Zarychta 2022-05-24 09:38:32 UTC
(In reply to Palle Girgensohn from comment #7)
Thanks for fixing this!