Revert "PostgreSQL 17: Add sysusers.d config file to allow rpm to create users/groups...
authorDevrim Gunduz <devrim@gunduz.org>
Sun, 21 Sep 2025 22:00:24 +0000 (17:00 -0500)
committerDevrim Gunduz <devrim@gunduz.org>
Sun, 21 Sep 2025 22:00:24 +0000 (17:00 -0500)
This reverts commit 2a5099724a5c0a0c6cf5afbd95199eb2fca857ec.

rpm/redhat/main/non-common/postgresql-17/main/postgresql-17-sysusers.conf [deleted file]
rpm/redhat/main/non-common/postgresql-17/main/postgresql-17.spec

diff --git a/rpm/redhat/main/non-common/postgresql-17/main/postgresql-17-sysusers.conf b/rpm/redhat/main/non-common/postgresql-17/main/postgresql-17-sysusers.conf
deleted file mode 100644 (file)
index aa3389d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-u postgres 26 'PostgreSQL Server' /var/lib/pgsql /usr/bin/bash
index e05f54cb2c0c336013270bc5d17f9a0ae5d10260..6c99f3def7f47bb289817502faa133024265953d 100644 (file)
@@ -43,7 +43,7 @@ Version:      17.6
 %if 0%{?suse_version} >= 1500
 # SuSE upstream packages have release numbers like 150200.5.19.1
 # which overrides our packages. Increase our release number on SuSE.
-Release:       420002PGDG%{?dist}
+Release:       420001PGDG%{?dist}
 %else
 Release:       3PGDG%{?dist}
 %endif
@@ -66,7 +66,6 @@ Source17:     %{sname}-%{pgmajorversion}-setup
 Source10:      %{sname}-%{pgmajorversion}-check-db-dir
 Source18:      %{sname}-%{pgmajorversion}.service
 Source19:      %{sname}-%{pgmajorversion}-tmpfiles.d
-Source20:      %{sname}-%{pgmajorversion}-sysusers.conf
 
 Patch1:                %{sname}-%{pgmajorversion}-rpm-pgsql.patch
 Patch3:                %{sname}-%{pgmajorversion}-conf.patch
@@ -667,9 +666,6 @@ touch -r %{SOURCE10} %{sname}-%{pgmajorversion}-check-db-dir
 %{__install} -d -m 755 %{buildroot}%{pgbaseinstdir}/share/
 %{__install} -m 700 %{SOURCE9} %{buildroot}%{pgbaseinstdir}/share/
 
-# Install sysusers.d config file to allow rpm to create users/groups automatically.
-%{__install} -m 0644 -D %{SOURCE20} %{buildroot}%{_sysusersdir}/%{sname}%{pgpackageversion}.conf
-
 %if %test
        # tests. There are many files included here that are unnecessary,
        # but include them anyway for completeness. We replace the original
@@ -767,6 +763,11 @@ cat initdb-%{pgmajorversion}.lang pg_ctl-%{pgmajorversion}.lang psql-%{pgmajorve
 cat postgres-%{pgmajorversion}.lang pg_resetwal-%{pgmajorversion}.lang pg_checksums-%{pgmajorversion}.lang pg_verifybackup-%{pgmajorversion}.lang pg_controldata-%{pgmajorversion}.lang plpgsql-%{pgmajorversion}.lang pg_test_timing-%{pgmajorversion}.lang pg_test_fsync-%{pgmajorversion}.lang pg_archivecleanup-%{pgmajorversion}.lang pg_waldump-%{pgmajorversion}.lang pg_rewind-%{pgmajorversion}.lang pg_upgrade-%{pgmajorversion}.lang > pg_server.lst
 %endif
 
+%pre server
+groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
+useradd -M -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
+       -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
+
 %post server
 /sbin/ldconfig
 if [ $1 -eq 1 ] ; then
@@ -1101,7 +1102,6 @@ fi
 %{pgbaseinstdir}/bin/%{sname}-%{pgmajorversion}-setup
 %{_bindir}/%{sname}-%{pgmajorversion}-setup
 %{pgbaseinstdir}/bin/%{sname}-%{pgmajorversion}-check-db-dir
-%{_sysusersdir}/%{sname}%{pgpackageversion}.conf
 %{_tmpfilesdir}/%{sname}-%{pgmajorversion}.conf
 %{_unitdir}/%{sname}-%{pgmajorversion}.service
 %if %pam
@@ -1230,7 +1230,6 @@ fi
 * Sun Sep 21 2025 Devrim Gunduz <devrim@gunduz.org> - 17.6-3PGDG
 - Add a temp patch from upstream to fix builds on Fedora 43 (LLVM 21).
   Will be removed in next minor release set.
-- Add sysusers.d config file to allow rpm to create users/groups automatically
 
 * Wed Aug 27 2025 Devrim Gunduz <devrim@gunduz.org> - 17.6-2PGDG
 - Rebuild against new GCC on Fedora 42