From bf738fa094f9765e2808247ea731ee1a07cfb855 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 22 Aug 2018 14:37:15 +0000 Subject: [PATCH] - change postgres homedir to /var/lib/pgsql --- postgresql.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/postgresql.spec b/postgresql.spec index 310108a..c0f9241 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -658,8 +658,7 @@ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \ $RPM_BUILD_ROOT/var/{lib/pgsql,log} \ $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \ - $RPM_BUILD_ROOT%{_mandir} \ - $RPM_BUILD_ROOT/home/services/postgres + $RPM_BUILD_ROOT%{_mandir} install src/tutorial/*.sql $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} @@ -757,6 +756,11 @@ if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then /usr/sbin/usermod -d /home/services/postgres postgres fi +%triggerpostun -- %{name} < 10.2-2 +if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then + /usr/sbin/usermod -d /var/lib/pgsql postgres +fi + %post /sbin/chkconfig --add postgresql10 %service postgresql10 restart "postgresql10 server" @@ -769,7 +773,7 @@ fi %pre -n postgresql-common %groupadd -g 88 -r postgres -%useradd -M -o -r -u 88 -d /home/services/postgres -s /bin/sh -g postgres -c "PostgreSQL Server" postgres +%useradd -M -o -r -u 88 -d /var/lib/pgsql -s /bin/sh -g postgres -c "PostgreSQL Server" postgres %post clients update-alternatives \ @@ -894,8 +898,6 @@ update-alternatives \ %dir %{pgsqldatadir}/contrib -%attr(700,postgres,postgres) /home/services/postgres -%attr(700,postgres,postgres) %dir /var/lib/pgsql %attr(640,postgres,postgres) %config(noreplace) %verify(not md5 mtime size) /var/log/pgsql %{pgsqldatadir}/man/man1/initdb.1* @@ -918,6 +920,7 @@ update-alternatives \ %defattr(644,root,root,755) %dir %{_libdir}/postgresql %dir %{_datadir}/postgresql +%attr(700,postgres,postgres) %dir /var/lib/pgsql %files dirs %defattr(644,root,root,755) -- 2.46.0