]> TLD Linux GIT Repositories - packages/postgresql.git/commitdiff
- moved data clusters to /var/lib/postgresql, misc fixes
authorMarcin Krol <hawk@tld-linux.org>
Fri, 24 Aug 2018 10:48:03 +0000 (10:48 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Fri, 24 Aug 2018 10:48:03 +0000 (10:48 +0000)
postgresql.init
postgresql.spec
postgresql.sysconfig

index 8f308171836413e5dd01472b7f7de22c59985606..394692c0f613a51b3eed459a47acbdcdfbefc58c 100644 (file)
@@ -123,7 +123,7 @@ start() {
                if [ "$PG_STATUS" = "running" ]; then
                        # pg_ctl status can misinform us about postgresql status
                        # so let's check if postmaster is really alive
-                       if ps -p "$PG_PID" >/dev/null; then
+                       if ps -p "$PG_PID" 1>/dev/null 2>&1; then
                                msg_already_running "PostgreSQL $pgdir"
                        else
                                # pg_ctl has misinformed us about postgresql status;
@@ -148,8 +148,8 @@ stop() {
                        msg_stopping "PostgreSQL $pgdir"
                        busy
                        # is postgresql really alive?
-                       if ps -p "$PG_PID" >/dev/null; then
-                               TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -w -D $pgdir stop -m fast 2>&1 >/dev/null"
+                       if ps -p "$PG_PID" 1>/dev/null 2>&1; then
+                               TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -w -D $pgdir stop -m fast 1>/dev/null 2>&1"
                                pgstatus "$pgdir"
                                if [ "$PG_STATUS" != "not running" ]; then
                                        fail
@@ -214,8 +214,8 @@ case "$action" in
                        msg_reloading "PostgreSQL $pgdir"
                        busy
                        # is postgresql really alive?
-                       if ps -p "$PG_PID" >/dev/null; then
-                               TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -D $pgdir $pgctlact 2>&1 >/dev/null"
+                       if ps -p "$PG_PID" 1>/dev/null 2>&1; then
+                               TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -D $pgdir $pgctlact 1>/dev/null 2>&1"
                                        pgstatus "$pgdir"
                                if [ "$PG_STATUS" = "running" ]; then
                                        ok
index 5163b5e110ea4b46b4a632342330b467ee3f9991..54f27bee0ec299284d513a46b732ff6765140118 100644 (file)
@@ -659,7 +659,7 @@ done
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
-       $RPM_BUILD_ROOT/var/{lib/pgsql,log,run/postgresql} \
+       $RPM_BUILD_ROOT/var/{lib/postgresql/%{pgsqlversion},log,run/postgresql} \
        $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
        $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
 
@@ -759,14 +759,14 @@ fi
 
 %triggerpostun -- postgresql < 10.5-2
 if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then
-       /usr/sbin/usermod -d /var/lib/pgsql postgres
+       /usr/sbin/usermod -d /var/lib/postgresql postgres
 fi
 echo
 echo "This version of PostgreSQL uses new default location for database clusters."
 echo "Please move your existing clusters before starting PostgreSQL so they follow"
 echo "below scheme:"
 echo
-echo "/var/lib/pgsql/<version>/<name>"
+echo "/var/lib/postgresql/<version>/<name>"
 echo
 echo "where <version> means PostgreSQL version like 9.6 or 10 and name is cluster"
 echo "name of your choice. When done, be sure to update /etc/sysconfig/postgresql*"
@@ -785,7 +785,7 @@ fi
 
 %pre   -n postgresql-common
 %groupadd -g 88 -r postgres
-%useradd -M -o -r -u 88 -d /var/lib/pgsql -s /bin/sh -g postgres -c "PostgreSQL Server" postgres
+%useradd -M -o -r -u 88 -d /var/lib/postgresql -s /bin/sh -g postgres -c "PostgreSQL Server" postgres
 
 %posttrans     clients
 update-alternatives \
@@ -926,7 +926,7 @@ fi
 %defattr(644,root,root,755)
 %dir %{_libdir}/postgresql
 %dir %{_datadir}/postgresql
-%attr(700,postgres,postgres) %dir /var/lib/pgsql
+%attr(700,postgres,postgres) %dir /var/lib/postgresql
 %attr(700,postgres,postgres) %dir /var/run/postgresql
 
 %files dirs
@@ -939,6 +939,7 @@ fi
 %dir %{pgsqldatadir}/man/man1
 %dir %{pgsqldatadir}/man/man3
 %dir %{pgsqldatadir}/man/man7
+%attr(700,postgres,postgres) %dir /var/lib/postgresql/%{pgsqlversion}
 
 %files doc
 %defattr(644,root,root,755)
index dde92829d38c934e86cab582cd42eaa00f3df563..bf550141ba2255a8da0c88255003a8c3b84a84ec 100644 (file)
@@ -9,10 +9,10 @@
 # PG_INIT_LOCALE=C
 
 # standard setting
-PG_DB_CLUSTERS="/var/lib/pgsql/@pgsqlversion@/main"
+PG_DB_CLUSTERS="/var/lib/postgresql/@pgsqlversion@/main"
 
 # predictable usage
-# PG_DB_CLUSTERS="/var/lib/pgsql/@pgsqlversion@/server1 /var/lib/pgsql/@pgsqlversion@/server2"
+# PG_DB_CLUSTERS="/var/lib/postgresql/@pgsqlversion@/server1 /var/lib/postgresql/@pgsqlversion@/server2"
 
 # new database disk arrived
-# PG_DB_CLUSTERS="/var/lib/pgsql/@pgsqlversion@/server1 /var/lib/pgsql/@pgsqlversion@/server2 /mnt/pgsql/@pgsqlversion@/server3"
+# PG_DB_CLUSTERS="/var/lib/postgresql/@pgsqlversion@/server1 /var/lib/postgresql/@pgsqlversion@/server2 /mnt/postgresql/@pgsqlversion@/server3"